Welcome to the GoFuckYourself.com - Adult Webmaster Forum forums.

You are currently viewing our boards as a guest which gives you limited access to view most discussions and access our other features. By joining our free community you will have access to post topics, communicate privately with other members (PM), respond to polls, upload content and access many other special features. Registration is fast, simple and absolutely free so please, join our community today!

If you have any problems with the registration process or your account login, please contact us.

Post New Thread Reply

Register GFY Rules Calendar Mark Forums Read
Go Back   GoFuckYourself.com - Adult Webmaster Forum > >
Discuss what's fucking going on, and which programs are best and worst. One-time "program" announcements from "established" webmasters are allowed.

 
Thread Tools
Old 10-20-2012, 08:12 AM   #1
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
Old 10-20-2012, 08:14 AM   #2
Vapid - BANNED FOR LIFE
Barterer
 
Industry Role:
Join Date: Aug 2004
Posts: 4,864
databases are matrices.
Vapid - BANNED FOR LIFE is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 10-20-2012, 08:55 AM   #3
MichaelP
Registered User
 
Industry Role:
Join Date: Aug 2003
Location: QWEBEC Corporate Office
Posts: 7,124
Quote:
Originally Posted by pornopete View Post
You're probably better off hiring somebody than spending your time on this.
Well I'd do this if I couldn't do any of it, but now I'm stuck on a simple query, so I won't hire a programmer for a single line of code ...
MichaelP is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 10-20-2012, 08:58 AM   #4
donborno
Confirmed User
 
Join Date: Jan 2007
Location: Vienna, Austria
Posts: 374
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
donborno is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 10-20-2012, 09:30 AM   #5
MichaelP
Registered User
 
Industry Role:
Join Date: Aug 2003
Location: QWEBEC Corporate Office
Posts: 7,124
Quote:
Originally Posted by donborno View Post
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
Not quite but Txs.

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
MichaelP is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 10-20-2012, 10:03 AM   #6
woj
<&(©¿©)&>
 
woj's Avatar
 
Industry Role:
Join Date: Jul 2002
Location: Chicago
Posts: 47,882
Quote:
Originally Posted by MichaelP View Post
Not quite but Txs.

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
If the other guy is busy, icq me: 33375924, I can help out..
__________________
Custom Software Development, email: woj#at#wojfun#.#com to discuss details or skype: wojl2000 or gchat: wojfun or telegram: wojl2000
Affiliate program tools: Hosted Galleries Manager Banner Manager Video Manager
Wordpress Affiliate Plugin Pic/Movie of the Day Fansign Generator Zip Manager
woj is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 10-20-2012, 10:05 AM   #7
sarettah
see you later, I'm gone
 
Industry Role:
Join Date: Oct 2002
Posts: 14,057
$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.

.
__________________
All cookies cleared!
sarettah is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 10-20-2012, 01:51 PM   #8
MichaelP
Registered User
 
Industry Role:
Join Date: Aug 2003
Location: QWEBEC Corporate Office
Posts: 7,124
Quote:
Originally Posted by woj View Post
If the other guy is busy, icq me: 33375924, I can help out..
Thank you Woj for the nice help

Was very fast and effective. Will take yu for work again for sure.

A+
MichaelP is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 10-20-2012, 03:03 PM   #9
sarettah
see you later, I'm gone
 
Industry Role:
Join Date: Oct 2002
Posts: 14,057
Quote:
Originally Posted by MichaelP View Post
Thank you Woj for the nice help

Was very fast and effective. Will take yu for work again for sure.

A+
Can't go wrong with WOJ

.
__________________
All cookies cleared!
sarettah is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 10-20-2012, 05:29 PM   #10
Bad18yroldvirginteens
So Fucking Banned
 
Industry Role:
Join Date: Oct 2012
Posts: 116
man complicated
Bad18yroldvirginteens is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 10-20-2012, 09:50 PM   #11
Lace
Too lazy to set a custom title
 
Lace's Avatar
 
Industry Role:
Join Date: Mar 2004
Posts: 16,116
Quote:
Originally Posted by sarettah View Post
Can't go wrong with WOJ

.
I've had friends hire WOJ before and he's always been great!
__________________
Your Paysite Partner
Strength In Numbers!
StickyDollars | RadicalCash | KennysPennies | HomegrownCash
Lace is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 10-20-2012, 10:23 PM   #12
Kiopa_Matt
Confirmed User
 
Industry Role:
Join Date: Oct 2007
Posts: 1,448
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;
You have three columns returned -- banner_id, program_id, site_name.
__________________
xMarkPro -- Ultimate Blog Network Management
Streamline your marketing operations. Centralize management of domains, pages, Wordpress blogs, sponsors, link codes, media items, sales and traffic statistics, plus more!
Kiopa_Matt is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 10-21-2012, 01:30 AM   #13
seeme
Stephen
 
Industry Role:
Join Date: Jun 2011
Location: Europe
Posts: 840
Quote:
Originally Posted by Kiopa_Matt View Post
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;
You have three columns returned -- banner_id, program_id, site_name.
seeme is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Post New Thread Reply
Go Back   GoFuckYourself.com - Adult Webmaster Forum > >

Bookmarks
Thread Tools



Advertising inquiries - marketing at gfy dot com

Contact Admin - Advertise - GFY Rules - Top

©2000-, AI Media Network Inc



Powered by vBulletin
Copyright © 2000- Jelsoft Enterprises Limited.