Jump to content

mysql - DW


Guest Xavier

Recommended Posts

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!

Link to comment
Share on other sites

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"; }

Link to comment
Share on other sites

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.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
×
  • Create New...