Where/what is the missing class reference? I realize what the error message is saying but I'm following the example in the ref manual almost verbatim. I'm trying to test my php_ini settings to see if I can make sure the mysqli_link connects before I add some code to it.
thanks,


$mysqli_link = new mysqli_connect(
ini_get("mysqli.default_host"),
ini_get("mysqli.default_user"),
ini_get("mysqli.default_passwd"),
'world',
ini_get("mysqli.default_port"),
ini_get("mysqli.default_socket"));


if ($mysqli->connect_error) {
    die('Connect Error (' . $mysqli->connect_errno . ') '
            . $mysqli->connect_error);
}else{


echo 'Success... ' . $mysqli->host_info . "\n";}

$mysqli->close();


error message:

Fatal error: Class 'mysqli_connect' not found in /Library/WebServer/Documents/mysqli_test.php on line 3

    jrough;10985918 wrote:

    I'm following the example in the ref manual almost verbatim.

    Perhaps you should follow the PHP manual instead of whichever manual you found? 😉

    There is no class called "mysqli_connect" unless you've created it yourself. Otherwise, there is the [man]MySQLi[/man] class, or there is the function [man]mysqli_connect/man.

      Write a Reply...