MySQL Forums
Forum List  »  PHP

Please help!!! Can't connect PHP with MySQL
Posted by: Refon Miah
Date: October 27, 2005 07:53AM

I have installed PHP5 and MySQL 5 on my PC (running on Windows XP). My web server is Apache. However, i am experiencing problems in connecting PHP to MySQL.

Below is the script for my database connectivity:
__________________________________________________________________
<?php

function db_connect()
{
$result = new mysqli('localhost', 'bm_user', 'password', 'bookmarks');
if (!$result)
throw new Exception('Could not connect to database server');
else
return $result;
}

?>
__________________________________________________________________

When i try to run this script, i receive a message saying - Fatal Error: Class 'mysqli' could not be found in ...'

Notes:

(1)I have added 'extension=php_mysqli.dll' to my php.ini file and uncommented it, but it has not made any difference.

(2)Also, when i run the script <?php phpinfo() ?>, there is no sections showing on MySQL or MySQLi.

Options: ReplyQuote


Subject
Written By
Posted
Please help!!! Can't connect PHP with MySQL
October 27, 2005 07:53AM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.