View Single Post
Old 10-20-2012, 08:12 AM  
MichaelP
Registered User
 
Industry Role:
Join Date: Aug 2003
Location: QWEBEC Corporate Office
Posts: 7,124
Need help with Left Join (MySQL)

Hey guys, I'm doing a bit of clean up in my stuff and I,m bulilding a new tool to manage my banners...

Here is what I try to accomplish (I know it's easy for a real programmer, which I'm not and never pretended to be)

Table programs : id , name ( ex : 22 , BabesMoney) ... +++

Table banner : id , program_id , site, (ex : 1 , 22 , Babes.Com) ... +++

Now here is the query which I play with... Not working but I know I'm close.. The query itself is pretty self explanatory

Code:
$query = "SELECT banner.*, programs.* FROM banner LEFT JOIN programs ON (program_id = programs.id, program = programs.program,) WHERE  blah, blah blah, meh meh meh... ";
So on the print, I want Program = BabesMoney instead of just 22

Thank in advance

Last edited by MichaelP; 10-20-2012 at 08:14 AM..
MichaelP is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote