Page 1 of 1

database question

Posted: Sat Oct 09, 2010 7:26 pm
by robynprivette
So I have three tables....

egg
hatch
er

let's use table egg as an example

in the table egg there are 2 columns, user and code

What code do I use to get all the code entries from one user?

Re: database question

Posted: Sat Oct 09, 2010 11:49 pm
by flying_circus
robynprivette wrote:So I have three tables....

egg
hatch
er

let's use table egg as an example

in the table egg there are 2 columns, user and code

What code do I use to get all the code entries from one user?
$user = mysql_real_escape_string($user);
SELECT `code` FROM `egg` WHERE `user`=$user;

Re: database question

Posted: Sun Oct 10, 2010 3:32 pm
by califdon
Your question isn't very specific, but I would say you need to read some basic tutorials on relational database theory. I recommend the following:
http://www.surfermall.com/relational/lesson_1.htm
http://www.kirupa.com/developer/php/rel ... design.htm
http://www.geekgirls.com/databases_from_scratch_3.htm
http://www.tekstenuitleg.net/en/article ... stics.html