asreall Posted July 4, 2013 Share Posted July 4, 2013 Good morning, i have come on my hands a knees asking for help as i am at a great loss and have no hair left to pull. I read the guideline and hope i have followed them correctly, please tell me otherwise. many thanks in advance. mysql Server version: 5.0.95 $db_host = "192.168.1.1"; $db_username = "useradmin"; $db_password = "admin101"; $db_name = "testproduct"; mysql_connect("$dbhost","$dbusername","$dbpassword") or die ("could not connect to mysql"); mysql_select("$dbname") or die ("no database"); (example information but have checked to make sure that it is correct ) i have uploaded the code above in a file called index.php to my server and when i try to load the page in the browser all i get returned is "could not connect to mysql" I have no idea as to why. many thanks Asreall Link to comment https://forums.phpfreaks.com/topic/279858-help-with-mysql-errors/ Share on other sites More sharing options...
Barand Posted July 4, 2013 Share Posted July 4, 2013 echo mysql_error() after code to see if an error occurred Link to comment https://forums.phpfreaks.com/topic/279858-help-with-mysql-errors/#findComment-1439403 Share on other sites More sharing options...
asreall Posted July 4, 2013 Author Share Posted July 4, 2013 In its own <?php ?> or with the rest of the code? Link to comment https://forums.phpfreaks.com/topic/279858-help-with-mysql-errors/#findComment-1439409 Share on other sites More sharing options...
asreall Posted July 4, 2013 Author Share Posted July 4, 2013 I would like to thank you for reply but I have resolved said issue Link to comment https://forums.phpfreaks.com/topic/279858-help-with-mysql-errors/#findComment-1439424 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.