Forum Moderators: coopster
I would like to do this in one statment but I supose I can use two.
also how would I then get the info with my $row=mysql_fetch_array($results)
$query = "SELECT tb1.col1,tb2.col3,tb2.col4 WHERE tb1.a_id = $a_id AND tb1.b_id = tb2.b_id";
Hope this helps!
eelix
$query = "SELECT
tb1.col1,
tb2.col3,
tb2.col4
FROM tb1
INNER JOIN tb2 ON (tb1.b_id = tb2.b_id)
WHERE tb1.a_id = $a_id
";
There is a thread in our PHP Forum Library [webmasterworld.com] that discusses the Basics of extracting data from MySQL [webmasterworld.com] that show how to process the returned result set.