Sorry very new to PHP I am currently working through a book and I am working on connect to a DB I use this command:

$db = new mysqli('localhost', 'bookorama', 'bookorama123', 'books');

and I get this error

Fatal error: Class 'mysqli' not found in c:\Inetpub\wwwroot\mystuff\chap11\results.php on line 26

from what i understand mysqli is a comman command so i would of though the clas would be standard. I presume my config is wrong. please can someone help me where have I gone wrong

I love this question, heres your answer below:

<?php
    $MySQL=mysql_connect("localhost","YOUR_USER","YOUR_PASS");
    mysql_select_db("YOUR_DATABASE",$MySQL);
  ?>

Heres another Example:

$dbhost = "localhost"; // SQL Database Hostname 
 $dbuname = "mikemsql_theman"; // SQL Username
 $dbpass = "imcool"; // SQL Password
 $dbname = "mikesql_num1"; // SQL Database Name	 
 $prefix = "profile"; // Your Database table's prefix 
 $user_prefix = "profile"; // Your Users' Database table's prefix (To share it)
 $dbtype = "MySQL"; // Your Database Server type. Supported servers are:  
 				 // MySQL, mysql4, postgres, mssql, oracle, msaccess, db2 and mssql-odbc
 				 // Be sure to write it exactly as above, case SeNsItIvE!

I hope this will help. If you need further assistance, visit back here.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.