I'm having trouble with a mysql loop.
I have three tables.
I need to query the first table, then it queries the second table, and it needs to loop the data from the third table.
Here is how I do it.
$id = $_GET['id'];
SELECT * FROM table_1 WHERE id='$id'
$row2 = $row['id_2'];
SELECT * FROM table_2 WHERE id='$row2'
$row3 = $_row['id_3'];
This is where I would use the while() loop and SELECT * FROM table_3 where id='$row3'
BUT..... it only prints out the FIRST value even thought I put a mysql_fetch_array loop.
Any help is appreciated.
Thanks!
I have three tables.
I need to query the first table, then it queries the second table, and it needs to loop the data from the third table.
Here is how I do it.
$id = $_GET['id'];
SELECT * FROM table_1 WHERE id='$id'
$row2 = $row['id_2'];
SELECT * FROM table_2 WHERE id='$row2'
$row3 = $_row['id_3'];
This is where I would use the while() loop and SELECT * FROM table_3 where id='$row3'
BUT..... it only prints out the FIRST value even thought I put a mysql_fetch_array loop.
Any help is appreciated.
Thanks!




