Hi there. We are creating a website for people to contribute to advertising.
Part of this process is for companies to state by which means they will 'Pay' for the job to be done, be it via Samples, Vouchers etc.
So we have setup a table that lists all the Payment Method options.
Admin can select which of those to be assigned the the Campaign.
Users can select which of those they prefer to use (one or more).
When Admins select the Campaign, they are shown all the Users from whom to select to 'run' the campaign, but it needs only show those who have selected which one they want to use. ie. Campaign 1 is for Vouchers, but not all Users will have said they want to be paid in vouchers - so it will only show those who HAVE chosen it,.
This is where our problem begins. So I am doing an SQL query that INNER JOINs these tables, so that when it comes to finding the users.... it finds them and asks if they have selected those options and then shows or doesn't show them in the list.
Bit like a CSS display:none. The initial query is a bit of a beast, so it's easier to - once the users are rendering - ask (do we need to show you).
This is the query so far:
$querypaymethod = ("SELECT `interest-promotions.id`, `interest-promotions.promotion` AS promotion, `promotion-influencers.userid`, `promotion-influencers.promoid` FROM `promotion-influencers` INNER JOIN `promotion-influencers` ON `promotion-influencers.promoid` = `interest-promotions.id` WHERE `promotion-influencers.userid` =:userid");
The problem is, I'm getting the infamous: #1066 - Not unique table/alias: 'promotion-influencers'.
Any ideas?
(Added [code]...[/code]
tags ~ MOD)