I have sql statement that adds results into the variable But when I put that variable($team) in my second sql statement it doesn't work WHERE id = '$team'. How would I go about this?
$query = mysql_query("SELECT team_name FROM team");
$team = array();
while($row = mysql_fetch_assoc($query)){
$team[] = $row;}
echo $arra[0];
$loop=count($team);
for($x=0;$x<$loop;$x++)
foreach($team[$x] as $child) {
$result = mysql_query("SELECT * FROM members
WHERE id = '$team'")
or die(mysql_error());
while($row = mysql_fetch_array( $result )) {
echo '<td>' . $row['first_name'] . '</td>';
}
echo $arra[0];may need to beecho $array[0];if you have a variable called$array, orecho array[0];orecho $team[0];--- either way,echo $arra[0];doesn't look right.mysql_*functions in new code, as it is deprecated and will be removed in the future.