我不明白为什么回声不显示价值。在phpmyadmin母猪查询中查询返回值很好。请帮忙

$query="SELECT `doctor_name` , `doctor_secondname`
FROM `doctors`
INNER JOIN `patients` ON `patients`.doctor_id = `doctors`.doctor_id
WHERE `patients`.patient_id = '{.$patient_id.}'" ;

$result = mysql_query($query) or die(mysql_error());

print_r($row);
if(mysql_num_rows($result) > 0) {
$row    = mysql_fetch_assoc($result);
echo "Your doctor is :";
echo $row['doctor_name'];
echo $row['doctor_secondname'];
   }

最佳答案

尝试这个:

$query="SELECT doctor_name , doctor_secondname
FROM doctors
INNER JOIN patients ON patients.doctor_id = doctors.doctor_id
WHERE patients.patient_id = '".$patient_id."'" ;

关于php - mysql_fetch_assoc()中的参数不希望显示;,我们在Stack Overflow上找到一个类似的问题:https://stackoverflow.com/questions/21797341/

10-15 21:05