Guest Xavier Posted November 2, 2010 Report Share Posted November 2, 2010 I'd like to test my connection to the server using the following: (as seen in videos, php-mysql-connecting-0-3) $my_connection=mysql_connect(‘localhost’, ‘root’, ‘’); as well as test my connection to a database on mysql: --just as you do on the videos-- $my_database = mysql_db(‘killer’); I am using dreamweaver and MAMP, and I can't do it, What do I do?, --I think the videos a re missing a step, I think there is something to fill out in DW in order to be able to connect to Mysql-- Thanks! Quote Link to comment Share on other sites More sharing options...
falkencreative Posted November 2, 2010 Report Share Posted November 2, 2010 Perhaps you can explain what you mean when you say "I can't do it"? The code you are using to connect to the DB looks correct, assuming you have created database called "killer", you are entering in the correct MySQL login details, and you are accessing the page using localhost while MAMP is running. To test the connection, you'd do something like this: $my_connection=mysql_connect(‘localhost’, ‘root’, ‘’); if ($my_connection == false) { echo "Unable to connect to MySQL"; } $my_database = mysql_db(‘killer’); if ($my_database == false) { echo "Unable to connect to DB"; } 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.
Note: Your post will require moderator approval before it will be visible.