ghqwerty Posted October 27, 2008 Share Posted October 27, 2008 when i go to my login page i get this error Warning: mysql_connect() [function.mysql-connect]: Can't connect to MySQL server on 'mysql4.000webhost.com' (4) in /home/a2350935/public_html/conn.php on line 10 however i havent changed it for ages and it has been working fine up to now. this is line 10 $dblink = mysql_connect ("$servername","$dbuser","$dbpassword")or die('CONNECTION ERROR: Could not connect to MySQL'); and this is the whole code <?php //conn.php $servername='mysql4.000webhost.com'; $dbusername='why should i say ?'; $dbpassword='not telling you !'; $dbname='stop being so nosy!'; function connecttodb($servername,$dbname,$dbuser,$dbpassword){ global $dblink; $dblink = mysql_connect ("$servername","$dbuser","$dbpassword")or die('CONNECTION ERROR: Could not connect to MySQL'); mysql_select_db("$dbname",$dblink) or die ('Could not open database'.mysql_error()); } connecttodb($servername,$dbname,$dbusername,$dbpassword); ?> Quote Link to comment https://forums.phpfreaks.com/topic/130237-solved-error-message-being-produced-in-my-login/ Share on other sites More sharing options...
Fruct0se Posted October 27, 2008 Share Posted October 27, 2008 $dbuser and $dbusername when you call the function are you using the right variable name? Quote Link to comment https://forums.phpfreaks.com/topic/130237-solved-error-message-being-produced-in-my-login/#findComment-675449 Share on other sites More sharing options...
ghqwerty Posted October 27, 2008 Author Share Posted October 27, 2008 yes i am - as i said it worked before and i havent changed anything and now it doesnt Quote Link to comment https://forums.phpfreaks.com/topic/130237-solved-error-message-being-produced-in-my-login/#findComment-675450 Share on other sites More sharing options...
Fruct0se Posted October 27, 2008 Share Posted October 27, 2008 It appears that 000webhosts SQL servers are down, no connection to any of them at the moment. Quote Link to comment https://forums.phpfreaks.com/topic/130237-solved-error-message-being-produced-in-my-login/#findComment-675453 Share on other sites More sharing options...
ghqwerty Posted October 27, 2008 Author Share Posted October 27, 2008 oo its back up now i also got a message in my database saying too much info needed - will keep an eye on this and change something if it happens again - thanks for the help Quote Link to comment https://forums.phpfreaks.com/topic/130237-solved-error-message-being-produced-in-my-login/#findComment-675455 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.