| | |
unable to connect to MYSQL via PHP
Please support our PHP advertiser: PostgreSQL or MySQL? Compare and contrast the two most popular open source databases
![]() |
•
•
Join Date: Feb 2009
Posts: 83
Reputation:
Solved Threads: 7
•
•
•
•
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
check the database name is there or not?
Can u send ur code...
•
•
Join Date: Dec 2008
Posts: 13
Reputation:
Solved Threads: 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
<?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
![]() |
Other Threads in the PHP Forum
- Previous Thread: Copy text between "start" and "end"
- Next Thread: phpMailer mail goes into junk folder
| Thread Tools | Search this Thread |
apache api array beginner binary broken cache cakephp checkbox class cms code confirm cron curl customizableitems database date display dynamic echo email error external fcc file files folder form forms forum freelancing function functions google header headmethod howtowriteathesis href htaccess html iframe image include insert ip javascript joomla limit link login mail malfunction menu method mlm mod_rewrite multiple mysql neutrality oop pageing pagerank paypal pdf php phpmysql play problem query question radio random recursion remote root script search select server sessions sms soap source space sql support! syntax system table template tutorial update upload url validator variable video web youtube






