MYSQL Problem

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
User avatar
Mastermind
Forum Commoner
Posts: 36
Joined: Thu Mar 10, 2005 2:38 am
Location: CDO,Philippines
Contact:

MYSQL Problem

Post by Mastermind »

What is the code and procedure to connect your mysql database in your php program give some tutorial i need to connect
User avatar
thomas777neo
Forum Contributor
Posts: 214
Joined: Mon Mar 10, 2003 6:12 am
Location: Johannesburg,South Africa

Post by thomas777neo »

You will find your answer in the manual.
User avatar
infolock
DevNet Resident
Posts: 1708
Joined: Wed Sep 25, 2002 7:47 pm

Post 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 ;)
User avatar
s.dot
Tranquility In Moderation
Posts: 5001
Joined: Sun Feb 06, 2005 7:18 pm
Location: Indiana

Post 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.
User avatar
Bill H
DevNet Resident
Posts: 1136
Joined: Sat Jun 01, 2002 10:16 am
Location: San Diego CA
Contact:

Post 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.
User avatar
Mastermind
Forum Commoner
Posts: 36
Joined: Thu Mar 10, 2005 2:38 am
Location: CDO,Philippines
Contact:

Post by Mastermind »

Thanks guy
Post Reply