PHP - MYSQL connection

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
IshGan
Forum Newbie
Posts: 4
Joined: Fri Jun 27, 2008 3:48 am

PHP - MYSQL connection

Post by IshGan »

Hi All
I am very new to PHP.

I am trying to connect to mysql server from PHP and the php page returns blank.

here is my code

Code: Select all

 
<?php
 
$mysqli = new mysqli("localhost", "ishuser", "somepass","testdb"); 
 
if (mysqli_connect_errno()) {
printf("connect failed: %s\n", mysqli_connect_error());
exit();
} else {
printf("Host information: %s\n", mysqli_get_host_info($mysqli));
mysqli_close($mysqli);
} 
 
?>
 
I am able to connect to mysql database using mysql command line.

Could someone please tell me what the problem is.

thanks
Ish
IshGan
Forum Newbie
Posts: 4
Joined: Fri Jun 27, 2008 3:48 am

Re: PHP - MYSQL connection

Post by IshGan »

adding extension to mysqli.dll to the ini file solved the problem.

thanks
Ish
Post Reply