If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > Database Server Software > MySQL > Inner Join returns False

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 10-06-09, 13:20
Schweppesale Schweppesale is offline
Registered User
 
Join Date: Jun 2009
Posts: 33
Inner Join returns False

Hi, the following query seems to be returning false. Any ideas?

Code:
$banner_table = $prefix.'banner';
$client_table = $prefix.'faclient';


$Query = "SELECT $banner_table.startdate
		, $banner_table.enddate
		, $banner_table.clicks
		, $banner_table.maxclicks
		, $banner_table.clientid
		, $client_table.clientid AS CID
		, $client_table.contactname
		, $client_table.contactemail	
	FROM $banner_table, $client_table
  INNER
	JOIN $client_table
	  ON $client_table.clientid = $banner_table.clientid";

$result = mysql_query($Query);
echo '<pre>';
echo print_r($Query);
echo '</pre>';

echo var_dump($result);
output:
Code:
SELECT startdate.jos_banner
		, jos_banner.enddate
		, jos_banner.clicks
		, jos_banner.maxclicks
		, jos_banner.clientid
		, jos_faclient.clientid AS CID
		, jos_faclient.contactname
		, jos_faclient.contactemail	
	FROM jos_banner, jos_faclient
  INNER
	JOIN jos_faclient
	  ON jos_faclient.clientid = jos_banner.clientid1

bool(false)

Last edited by Schweppesale; 10-06-09 at 13:24.
Reply With Quote
  #2 (permalink)  
Old 10-06-09, 13:24
Schweppesale Schweppesale is offline
Registered User
 
Join Date: Jun 2009
Posts: 33
changed the first line to

$Query = "SELECT $banner_table.startdate

still no luck :P
Reply With Quote
  #3 (permalink)  
Old 10-06-09, 13:43
Schweppesale Schweppesale is offline
Registered User
 
Join Date: Jun 2009
Posts: 33
this worked.


Code:
$Query = "SELECT $banner_table.startdate
      , $banner_table.enddate
      , $banner_table.clicks
      , $banner_table.maxclicks
      , $banner_table.clientid
      , $client_table.clientid AS CID
      , $client_table.contactname
      , $client_table.contactemail   
   FROM $banner_table
  INNER
   JOIN $client_table
     ON $client_table.clientid = $banner_table.clientid";
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On