Results 1 to 3 of 3
  1. #1
    Join Date
    Jun 2009
    Posts
    33

    Unanswered: 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 14:24.

  2. #2
    Join Date
    Jun 2009
    Posts
    33
    changed the first line to

    $Query = "SELECT $banner_table.startdate

    still no luck :P

  3. #3
    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";

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •