0

My system is a stand alone system, I want to connect to MYSQL using PHP, I am giving hostname as localhost, and the needed username and passoword. In the browser i am getting Internal server error 500.


Any sort of help much appreciated,
Thank you

3
Contributors
3
Replies
4
Views
8 Years
Discussion Span
Last Post by nav33n
0

My system is a stand alone system, I want to connect to MYSQL using PHP, I am giving hostname as localhost, and the needed username and passoword. In the browser i am getting Internal server error 500.


Any sort of help much appreciated,
Thank you

hi..
check the database name is there or not?
Can u send ur code...

0

This is my code:
<?php
$username = "aaa";
$password = "aaa";
$hostname = "localhost";
$dbh=mysql_connect($hostname, $username, $password)
or
die("unable to connect to the datatabase");
print "connected to MYSQL<br>";
mysql_close($dbh);
?>
/*I am not giving any database name, initially i just want to connect to MySql database*/

Thank you

0

Try or die(mysql_error()); instead of your custom message. This will let you know what exactly is the error.

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.