Jump to content

Querying three tables at once


stubarny

Recommended Posts

Hi everyone,

 

I'm trying to query a recruitment website database to find the live jobs (from table "ads_live"), archived jobs (from table "ads_not_live") and payment transactions (from table "transactions") for an account's username (stored in $_SESSION[account_username]).

 

$sql = "SELECT * FROM ads_live, ads_not_live, transactions WHERE ad_account_username  = '$_SESSION[account_username]'";

 

 

The above code fails and i can only google information on seeing if columns in different tables equal each other, rather than a variable.

 

Thanks for your help!

 

Stu

Link to comment
https://forums.phpfreaks.com/topic/43556-querying-three-tables-at-once/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.