gpt4 book ai didi

php - mysql_fetch_assoc() 中的参数不想显示;

转载 作者:行者123 更新时间:2023-11-30 00:40:35 24 4
gpt4 key购买 nike

我不明白为什么 echo 不显示值。在phpmyadmin sow查询中查询返回值就可以了。请帮忙

$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/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com