hanadeka80 Posted October 16, 2008 Share Posted October 16, 2008 pls..i do need help..i can't connect my site to the database that i made. i have already change the details in my php script with the one provided by the web hosting site.pls..help me with this one..i'm getting the error: Warning: mysql_select_db() [function.mysql-select-db]: Access denied for user 'ODBC'@'localhost' (using password: NO) in C:\Program Files\xampp\htdocs\xampp\GPS_Php4\connection.php on line 24 Warning: mysql_select_db() [function.mysql-select-db]: A link to the server could not be established in C:\Program Files\xampp\htdocs\xampp\GPS_Php4\connection.php on line 24 <?php $mysql_host = "mysql3.000webhost.com"; $mysql_database = "a5200862_shop"; $mysql_user = "a5200862_tine"; $mysql_password = "youknowwho"; if($con=@mysql_connect($mysql_host,$mysql_user,$mysql_password)) { echo "You are connected"; } else { echo "Not Connected"; } $con=mysql_select_db($mysql_database); ?> i've already check the table names and column also the database name and so on..pls,...help help..i really need to pass this project.. thank you so much in advance!!! Quote Link to comment Share on other sites More sharing options...
beansandsausages Posted October 16, 2008 Share Posted October 16, 2008 Try: mysql_connect("mysql3.000webhost.com", "a5200862_tine", "youknowwho") or die(mysql_error()); mysql_select_db("a5200862_shop") or die(mysql_error()); Quote Link to comment Share on other sites More sharing options...
hanadeka80 Posted October 16, 2008 Author Share Posted October 16, 2008 i used your codes but still i'm not able to connect to the database..It falls on the die statement which is "error in selecting db".. and i've check the database name over and over again..i really don't have any idea what's going on..there server is still up by the way..any comments..plss...i really need help ??? Quote Link to comment Share on other sites More sharing options...
beansandsausages Posted October 16, 2008 Share Posted October 16, 2008 so it must mean there is no information in the data base maybe? Quote Link to comment Share on other sites More sharing options...
PFMaBiSmAd Posted October 16, 2008 Share Posted October 16, 2008 Post the current code and the error message. The original code did not stop when there was an error with the msyql_connect(), so the mysql_select_db() attempted to make a connection using default values, which failed. You should have received the "Not Connected" message. Quote Link to comment 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.