How to check the data in another table field
Now I have a tb_activity table and a tb_participate table
The P_activity field in table Tb_participate is the same as the A_num value in table tb_activity
Pass
$sql 8= "SELECT * from tb_participate where p_voluteer = ' $fnum '";
$result 8=mysql_query ($sql 8) or Die (' database query failed! ');
while ($row =mysql_fetch_array ($result 8)) {
echo $row [' p_activity ']. '
';
}
?>
I can output all the values of the P_activity field in the table Tb_participate (that is, the A_num value in table tb_activity)
But I want to output the value of the A_name field in the table tb_activity at the same time
How should I rewrite the code?
Share to:
------Solution--------------------
This post was last edited by xuzuning on 2013-05-17 16:10:58
echo $row [' tb_participate.p_activity ']. ' '. $row [' Tb_activity.a_name ']. '
'
How did you write that? I didn't ask you to write that, did I?
echo $row [' p_activity ']. ' '. $row [' A_name ']. '
'
------Solution--------------------
P_voluteer = ' 90901 There is no tb_participate.p_activity=tb_activity.a_num data, so there is no display.