Page 1 of 1

MYSQL Problem

Posted: Wed Mar 16, 2005 3:11 am
by Mastermind
What is the code and procedure to connect your mysql database in your php program give some tutorial i need to connect

Posted: Wed Mar 16, 2005 3:19 am
by thomas777neo
You will find your answer in the manual.

Posted: Wed Mar 16, 2005 3:39 am
by infolock
http://www.php.net/mysql is the best place to start for learning how to communicate with mysql. don't get frustrated with this response. we could tell you all day how to do it, but you won't learn, thus your attempts at php will be in vain. however, look at the bright side. in 10 minutes max you'll see the answer and a nice explanation on how to connect to it, and do other things as well...all the while learning ;)

Posted: Wed Mar 16, 2005 7:40 am
by s.dot
Well, I suppose I'll give you the answer you like, and the answer the people on this forum will hate. But I learn things by doing, and being shown, so I will show you how.

Code: Select all

$db = mysql_connect("hostname", "username", "password");
mysql_select_db("database_name", $db);
I hope you will look at this syntax and not just copy/paste.

Posted: Wed Mar 16, 2005 10:00 am
by Bill H
The problem with that, scrotaye, is that in a day or so we will get another request like, "How do I insert data?" and then "How do I find out what the database holds?" If the reader actually goes to the manual and reads it, he will learn far, far more than asking individual questions since he will learn things about which he would not have thought to ask.

Posted: Wed Mar 16, 2005 9:18 pm
by Mastermind
Thanks guy