|
| |
|
|
iany
Posts: 98 Joined: 10/14/2004 Status: offline
|
Left Join not working - 11/4/2005 3:47:25
One of my left joins is not working. Here is query $ql="SELECT profiles.keywords,profiles.profile,profiles.user_id, profiles.location, profiles.industrysector,industrysector.*, jobcategory.*, locations.* FROM profiles LEFT JOIN industrysector ON profiles.industrysector = industrysector.industrysectorcode LEFT JOIN jobcategory ON profiles.jobcategory = jobcategory.jobcategorynumber LEFT JOIN locations ON profiles.location = locations.locationnumber WHERE profiles.user_id=$user_id"; $result=mysql_query($ql); // Fetch and print all the records. //while $row = mysql_fetch_array($result, MYSQL_ASSOC) First two joins work fine but third returns the number not the category. Now as there is a wild card entry using '%' I am using the following condition: <?php If ($location =='%') { //Print ANY print 'Any'; } else print $row['location']; ?> Any thoughts?
|
|
New Messages |
No New Messages |
Hot Topic w/ New Messages |
Hot Topic w/o New Messages |
Locked w/ New Messages |
Locked w/o New Messages |
|
Post New Thread
Reply to Message
Post New Poll
Submit Vote
Delete My Own Post
Delete My Own Thread
Rate Posts
|
|
|