•
•
•
•
What is DaniWeb IT Discussion Community?
You're currently browsing the PHP section within the Web Development category of DaniWeb, a massive community of 391,588 software developers, web developers, Internet marketers, and tech gurus who are all enthusiastic about making contacts, networking, and learning from each other. In fact, there are 2,677 IT professionals currently interacting right now! Registration is free, only takes a minute and lets you enjoy all of the interactive features of the site.
Please support our PHP advertiser: Lunarpages PHP Web Hosting
Views: 3195 | Replies: 1
![]() |
•
•
Join Date: Jan 2005
Posts: 1
Reputation:
Rep Power: 0
Solved Threads: 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
$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
•
•
Join Date: Dec 2004
Location: Fort Bragg, NC
Posts: 189
Reputation:
Rep Power: 4
Solved Threads: 2
I love this question, heres your answer below:
[PHP]<?php
$MySQL=mysql_connect("localhost","YOUR_USER","YOUR_PASS");
mysql_select_db("YOUR_DATABASE",$MySQL);
?>[/PHP]
Heres another Example:
[PHP]
$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![/PHP]
I hope this will help. If you need further assistance, visit back here.
[PHP]<?php
$MySQL=mysql_connect("localhost","YOUR_USER","YOUR_PASS");
mysql_select_db("YOUR_DATABASE",$MySQL);
?>[/PHP]
Heres another Example:
[PHP]
$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![/PHP]
I hope this will help. If you need further assistance, visit back here.
dynastyCODERS#1 when it comes to Programming Tutorials, Database designs and discussions, Operating Systems, you name it, check us out and drop us a line to tell us your opinions on any and everything in mind!;)
![]() |
•
•
•
•
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
•
•
•
•
•
•
•
•
DaniWeb PHP Marketplace
Similar Threads
- 56k connecting at 12k-18k????? (Networking Hardware Configuration)
- My Pc keeps restarting when connecting to the internet (Troubleshooting Dead Machines)
- can only open my documents after connecting to internet (Web Browsers)
- connecting to internet mac (OS X)
- Connecting via Winmatrix to Access (ASP.NET)
- Connecting Peak wireless router to Motorola SB4100 cable modem (Networking Hardware Configuration)
- Problem connecting to the internet (Web Browsers)
Other Threads in the PHP Forum
- Previous Thread: auto incrememnt mysql
- Next Thread: Can anyone answer a few questions, please.


Linear Mode