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 Quote Link to comment 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 Quote Link to comment 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? Quote Link to comment 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 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.