|
|
|||||||||
|
|||||||||
| |||||||||
|
|
|
| ||||||||||||||||||||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
#1
|
|||
|
|||
|
mysql join question
hi there,
Have two tables signup - with id, fname,lname members - memberId, fName, lName I don't have the tables relating yet except by first names and last names. The primary key in sign up is id while the primary key in members is memberid. When I run this query, I don't get the records Iam looking for. I am hoping to get the signupID and update the members table as a foreign key... but I am not getting there. $sql_result = mysql_query("SELECT *, members.fName,members.lName FROM signup,members WHERE signup.id = $newID AND signup.fname = 'members.fName' AND signup.lname ='members.lName';"); The problem is that I have 170 nember records and now I need to authenticat the member for signup purposes. This is a case where I should have create the signup process first but the customer was dying to get the member data added. thanks ~cherylw |
|
#2
|
|||
|
|||
|
RE: mysql join question
it seems your selecting 2 tables.. thats fine but:
1. The tables have diff names 2. There should be `'s around the table names 3. Use quotes("'s) around the WHERE (bla) = "(something)" try using: [highlight=php] $sql_result = mysql_query("SELECT * FROM `signup,members` WHERE signup.id = "$newID AND signup.fname = "members.fName" AND signup.lname = "members.lName";"); |
![]() |
| Viewing: Codewalkers Forums > Other Technologies > Database Help > mysql join question |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|
|