devdas_kamath Posted November 22, 2007 Share Posted November 22, 2007 I have installed mysql and php5 in my machine. mysql server is running. Apache is also running. normal page displayed correctly with following code. <html> <head> "Heading" </head> <body> <?php echo "Hi this php"; $dbcnx = @mysql_connect('localhost', 'root', 'winman') or die("d"); mysql_select_db("winmannodb") or die("<b>could not select database</b>."); ?> </body> </html> the word 'hi this is php' comes in the browser but no message for mysql connection even if database is given wrong which is not there in the mysql server. pls advice. thanking u Link to comment https://forums.phpfreaks.com/topic/78356-could-not-connect-to-mysql/ Share on other sites More sharing options...
~n[EO]n~ Posted November 22, 2007 Share Posted November 22, 2007 Try like this, your echo will run cause it has nothing to do with mysql connection <?php error_reporting(E_ALL); echo "Hi this php"; $dbcnx = mysql_connect('localhost', 'root', 'winman') or die("d"); mysql_select_db("winmannodb") or die("could not select database."); ?> <html> <head> "Heading" </head> <body> </body> </html> In php.ini see if this line is uncommented extension=php_mysql.dll Link to comment https://forums.phpfreaks.com/topic/78356-could-not-connect-to-mysql/#findComment-396473 Share on other sites More sharing options...
Zane Posted November 22, 2007 Share Posted November 22, 2007 go into your PHP directory..find libmysql.dll libmysqli.dll and copy them to your windows system32 folder restart apache and check your php info page ie <?php echo phpinfo(); ?> Mysql should appear ...hopefully Link to comment https://forums.phpfreaks.com/topic/78356-could-not-connect-to-mysql/#findComment-396598 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.