catfan / Medoo

The lightweight PHP database framework to accelerate the development.
https://medoo.in
MIT License
4.83k stars 1.15k forks source link

undefined variable attr? #770

Closed newjie closed 6 years ago

newjie commented 6 years ago

Here is my simple code to test if Medoo is running properly. Medoo.php is on the same folder.

<?php
  require 'Medoo.php';
  use Medoo\Medoo;
  $d = new Medoo([
    'database_type' => 'mysqli',
    'database_name' => 'sasky',
    'server' => 'localhost',
    'username' => 'sasky',
    'password' => 'something'
  ]);

However, I get error log like this:

PHP Notice: Undefined variable: attr in /home/sasky/public_html/Medoo.php on line 206 PHP Notice: Undefined variable: attr in /home/sasky/public_html/Medoo.php on line 208 PHP Notice: Undefined variable: attr in /home/sasky/public_html/Medoo.php on line 212 PHP Warning: Invalid argument supplied for foreach() in /home/sasky/public_html/Medoo.php on line 212 PHP Fatal error: Uncaught PDOException: could not find driver in /home/sasky/public_html/Medoo.php:241

What causes this? Is it because the PDO driver was not properly installed? Here's my phpinfo: sasky.nycweb.io/info.php

catfan commented 6 years ago

database_type should be mysql not mysqli.