Linking tables

Questions about the MySQL, PostgreSQL, and most other databases, as well as using it with PHP can be asked here.

Moderator: General Moderators

Post Reply
hijacker
Forum Newbie
Posts: 4
Joined: Wed May 24, 2006 5:30 pm

Linking tables

Post by hijacker »

Yup, Im a newbie to these forums, but not to php. I have know and learned php for about a year now, but im not an expert... Im only 14 actually. But whatever, I remember about reading something about using a simalar object (dont know there real name) to connect 2+ tables in the same database. Can someone help me out on this?
User avatar
Burrito
Spockulator
Posts: 4715
Joined: Wed Feb 04, 2004 8:15 pm
Location: Eden, Utah

Post by Burrito »

define 'connect two tables'.

do you mean you want to 'join' two tables in a sql query?
hijacker
Forum Newbie
Posts: 4
Joined: Wed May 24, 2006 5:30 pm

Post by hijacker »

No, Like lets say i have a table that have Num and Username in a table an in another i have Username and Password. I remember readin somewhere i can use the Username in each of them to use data between the 2.
User avatar
Burrito
Spockulator
Posts: 4715
Joined: Wed Feb 04, 2004 8:15 pm
Location: Eden, Utah

Post by Burrito »

that sounds like you're talking about a 'join'.

there are a few different join types.

inner, left, =, etc.

take a look here for more info on sql joins: http://dev.mysql.com/doc/refman/5.0/en/join.html
User avatar
feyd
Neighborhood Spidermoddy
Posts: 31559
Joined: Mon Mar 29, 2004 3:24 pm
Location: Bothell, Washington, USA

Post by feyd »

Post Reply