Hello all. I hope you can help me.
I have two tables, Table1 and Table2. When i submit a name from my form ( eg : jimmy ), 'jimmy' is inserted into both tables. Now this part is fine. In the output, it displays the data from both tables ( output: jimmy - jimmy )
The problem i am having lies in my sql statement i believe.
Basically, the way i have it now, it says, if 'jimmy' is in Table1 AND in Table2, output the results, otherwise forget it!
It does not output anything if 'jimmy' is in NOT in Table1 but IS in Table2, or vice versa.
My code :
Hopefully someone can guide me in the right direction.
thanks
-- tarja
I have two tables, Table1 and Table2. When i submit a name from my form ( eg : jimmy ), 'jimmy' is inserted into both tables. Now this part is fine. In the output, it displays the data from both tables ( output: jimmy - jimmy )
The problem i am having lies in my sql statement i believe.
Basically, the way i have it now, it says, if 'jimmy' is in Table1 AND in Table2, output the results, otherwise forget it!
It does not output anything if 'jimmy' is in NOT in Table1 but IS in Table2, or vice versa.
My code :
Code:
$result = mysql_query("SELECT".
"`TABLE1`.username,".
"`TABLE2`.username ".
FROM".
"`TABLE1`,".
"`TABLE2`".
"WHERE".
"`TABLE1`.username = `TABLE2`.username ".
"") or die(mysql_error());
Hopefully someone can guide me in the right direction.
thanks
-- tarja