0

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

2
Contributors
1
Reply
2
Views
12 Years
Discussion Span
Last Post by mikeSQL
0

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.

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.