Jump to content

mysql_connect function not responding?


doloreel

Recommended Posts

the mysql_connect() statement will always run (assuming the function is defined.) if the connection fails, the function call will return a false value to the calling code. do you have any logic in your code to test if that function returns a false value?

this is my code now, it just returns 'could not connect' although phpmyadmin is running and i have input everything correctly. any ideas?

<?php
	if (!@mysql_connect('localhost', 'root', '') || !@mysql_select_db('a_database')) {
		die('could not connect');
	} 
?>


Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.