From a php-general thread earlier:

  $db=new mysqli('localhost','whil','secret','test');


  Fatal error: Call to undefined function new mysqli() in index.php on
  line 24


  $conn = mysqli_connect("localhost","whil","secret","test");
  echo 'conn good: '.$conn.' :very good indeed<br>';

generates success:

  conn good: Object id #1 :very good indeed

The book I'm working with (PHP & MySQL Web Dev, Welling/Thompson) specifically defines the 'new mysqli' syntax. So I'm guessing I don't have something configured right?


I don't see a constructor for mysqli at
Your book is probably defining a class that you didn't include/require. For example, search for the following at the php page above:
try {
   $mysql = new safe_mysqli

You will need to have the class your book is defining before you can instantiate such an object.

Find a local pizza place, movie theater, and moreĀ….then map the best route!

PHP Database Mailing List (
To unsubscribe, visit:

Reply via email to