Forum Moderators: coopster

Message Too Old, No Replies

PHP MySQL loop in loop

         

j milo taylor

9:54 pm on Aug 5, 2009 (gmt 0)

10+ Year Member



Hi everyone,

I've got a real headache here:

mysql_select_db($database_immapp, $immapp);
$recordID = $_GET['recordID'];
$query_rs_country = "SELECT

*

FROM artist

LEFT OUTER JOIN artist_nodes
on id_artist = artistID_artist_nodes

WHERE location_id_artist = $recordID ORDER BY 'year_artist'";
$rs_country = mysql_query($query_rs_country, $immapp) or die(mysql_error());
$row_rs_country = mysql_fetch_assoc($rs_country);
$totalRows_rs_country = mysql_num_rows($rs_country);

which I need to (somehow) JOIN to nodes table
on id_node = nodeID_artist_nodes

as is i get 334 records back, it should be 34.

each node.node_node then needs to be looped through within each record for $row_rs_country.

I spent a couple of days on this and am getting nowhere.

Can anyone help?

Cheers,
Milo

coopster

4:41 pm on Aug 8, 2009 (gmt 0)

WebmasterWorld Administrator 10+ Year Member



INNER JOIN instead of LEFT JOIN?

j milo taylor

8:10 pm on Aug 12, 2009 (gmt 0)

10+ Year Member



Nope,

INNER JOIN does the same

:-(