Menu

Please help on "Undefined SQL error"

karlhui
2016-03-17
2016-10-15
  • karlhui

    karlhui - 2016-03-17

    Dear all,

    I'm just installed phpDHCPAdmin in my ubuntu server, and encountered an error when I login:

    "Undefined SQL error. You may wish to check the configuration setup."

    I checked mysql account (both root and phpDHCPAdmin) has the permission to access and edit phpDHCPAdmin database, and here is my details inc.config.php:

    // database configuration
    $defined['hostname'] = "192.168.86.1";
    $defined['dbhost'] = "localhost";
    $defined['username'] = "root";
    $defined['password'] = "password";
    $defined['dbname'] = "phpDHCPAdmin";

    // application path information
    $defined['virpath'] = "/var/www/html/phpDHCPAdmin/";

    Could anyone please let me know how to fix this one?

    Thanks
    karlhui

     

    Last edit: karlhui 2016-03-17
  • jas

    jas - 2016-10-15

    It is the MySQL libraries included with PHP.

    You can verify this with something like; var_dump(function_exists(mysql_connect));

    The phpDHCPAdmin project makes use of the 'mysql' functions for connections, queries etc defined @ http://php.net/manual/en/book.mysql.php.

    They are considered legacy and are no longer activly maintained by the PHP community.

    PHP now recommends a minimal use of the 'mysqli' series of functions.and this project (as well as others) should be using the newest standard PDO drivers available for MySQL & other RDMS transactions.

    If you are familiar with PHP & MySQL programming you can always modify the https://github.com/jas-/phpDHCPAdmin/blob/452df9b18988dc7e51085ab957d1a880fab2c5c8/scripts/classes/class.dbase.php file to bring it up to speed with the MySQLi functionality.

    I no longer maintain this code base but can be modified to support the newer PHP functionality as long as you maintain the class & function calls defined in the class.dbase.php file provided in the link.

     

Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.