How to check the data in another table field

Source: Internet
Author: User
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.
  • Contact Us

    The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

    If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

    A Free Trial That Lets You Build Big!

    Start building with 50+ products and up to 12 months usage for Elastic Compute Service

    • Sales Support

      1 on 1 presale consultation

    • After-Sales Support

      24/7 Technical Support 6 Free Tickets per Quarter Faster Response

    • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.