2 tables: C and P (contacts and phone)
C = id, name
P = id, cid, num : where cid corresponds to C.id
a contact in C can exist without having any P associated with it. For instance if someone would delete all P's associated with C. But in my current selection I only get C if P.cid = C.id. So now a user can never add a new number to a contact because the contact does't show up from my query. I know how to do this if I select id from C. and then in cgi script go ahead and query each P.cid , but I am sure there is some cleaver way to do this in one query.
Is it possible to do this in one QUERY. I need all C.id and C.name and if P.cid = C.id I want them too.
So it would look like this:
3---Jim ---- (no phone avail) - <currently won't be returned>
5---Jan ---- (no phone avail) - <currently won't be returned>
CURRENT QUERY WITH PROBLEM:
contacts.name as "Name",
num as "PhoneNum",
FROM pnum INNER JOIN contacts ON pnum.cid = contacts.id;
it only selects C that have P associated (where P.cid=C.id)