I need the best way of performing the following task. If possible, take it all the way down to giving me variables for output so i can better see whats going on, a lot of times you guys assume im smarter than i am.
Table 1, holds user information, first and last name, email etc. The primary auto_increment key in table 1 is id. Table 2, holds a series of first and last names, its key is xid, and the table 1 id (used to display only the owners list) is uid. Table 3, holds config data for the user's list in table 2. Since you can have multiple configs per list per user, it wasnt prudent to include it in table 2. So table 3 has cxid (the table 2 key of xid, marking which list its for), and then uid, marking which table 1 user can access that config. Its auto_increment key is called cid.
So to break it down
Table 1(user) - Primary key = id
Table 2(list) - Primary key = xid, and user field is uid.
Table 3(config) - Primary key = cid, list field is cxid, and user field is uid.
What i need to do, is formulate a mysql query on table 3, so that for every row, it extracts the cxid, and uid, then queries table 2 for the specific list. Once it finds the list, it needs to extract all data from that row in table 2, so that it can perform a function with that data.
Im not exactly sure where to start on writing this the most efficient way, im sure there is some kind of easy way of doing this. For the time being, the above values are just being passed in the URL, but i am going to change that to sessions, but just assume that before the query even starts, that ive defined each variable as
$variable = $_GET['variable'];
So the variables are $id, $uid, $cxid, $xid