needhelp123 Posted November 8, 2010 Share Posted November 8, 2010 I am developing a database based website and i have been using my pc as a server to test everything. but the thing is that i need to use a school server to host the website. when i try to connect to the database on my computer using: mysql_connect('localhost', 'mysql_user', 'mysql_password'); everything works fine, it connects and i can test the database. but when i login in to my school server through ssh, i am having trouble connecting to the database. so how do i go to connecting to that database? i guess using mysql_connect('localhost', 'mysql_user', 'mysql_password'); wouldn't work here because the host name should be something other than localhost? Quote Link to comment https://forums.phpfreaks.com/topic/218070-help-connect-to-mysql-database/ Share on other sites More sharing options...
jdavidbakr Posted November 11, 2010 Share Posted November 11, 2010 Does the school server have MySQL running on it and have the connection credentials you are trying to connect to on it? If you echo mysql_error() after the failed connection it will tell you exactly why it's not working. Quote Link to comment https://forums.phpfreaks.com/topic/218070-help-connect-to-mysql-database/#findComment-1133223 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.