![]() |
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:
Thank in advance |
databases are matrices.
|
Quote:
|
SELECT banner.id, programs.name, banner.site
FROM banner LEFT JOIN programs ON banner.program_id = programs.id WHERE blah, blah blah, meh meh meh... Probably it's an INNER JOIN unless you have banners which do not reference a program |
Quote:
hey May I hire you for an hour or so? I can pay Paypal... I have a good name here and I want to keep it. Hit me up on ICQ pls @ 139036653 :thumbsup |
Quote:
|
$query = "SELECT banner.*, programs.* FROM banner LEFT JOIN programs ON (program_id = programs.id, program = programs.program,)
Do you actually have that comma before the close paren in there. Because that will screw it for you. . |
Quote:
Was very fast and effective. Will take yu for work again for sure. A+ :thumbsup |
Quote:
. |
man complicated
|
Quote:
|
Code:
SELECT banner.id AS banner_id, banner.program_id AS program_id, programs.site AS site_name FROM banner, programs WHERE banner.program_id = programs.id; |
Quote:
|
All times are GMT -7. The time now is 01:34 AM. |
Powered by vBulletin® Version 3.8.8
Copyright ©2000 - 2025, vBulletin Solutions, Inc.
©2000-, AI Media Network Inc