navigation
a webmaster learning community
     Home    Register     Search      Help      Login    
Sponsors

Shopping Cart Software
Ecommerce software integrated into Frontpage, Dreamweaver and Golive templates. No monthly fees and available in ASP and PHP versions.

Website Templates
We also have a wide selection of Dreamweaver, Expression Web and Frontpage templates as well as webmaster tools and CSS layouts.

Frontpage website templates
Creative Website Templates for FrontPage, Dreamweaver, Flash, SwishMax

Search Forums
 

Advanced search
Recent Posts

 Todays Posts
 Most Active posts
 Posts since last visit
 My Recent Posts
 Mark posts read

 

Left Join not working

 
View related threads: (in this forum | in all forums)

Logged in as: Guest
Users viewing this topic: none
Printable Version 

All Forums >> Web Development >> ASP and Database >> Left Join not working
Page: [1]
 
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?

Page:   [1]

All Forums >> Web Development >> ASP and Database >> Left Join not working
Page: [1]
Jump to: 1





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