0
我尝试从合并表获取存储在由特定行SQL数据获取数据的特定行由一个ID指定的合并表
这是我试过到目前为止
<?php
$id = $_GET['id'];
$getdetails = mysql_query("SELECT
scholarship.scholarshipid,
scholarship.scholarshipname,
scholarship.shortdescription,
scholarship.scholarshippicture,
scholarshipdetail.fulldescription,
scholarshipdetail.degreetype,
scholarshipdetail.location,
scholarshipdetail.deadline
FROM scholarship, scholarshipdetail
WHERE scholarship.scholarshipid = scholarshipdetail.scholarshipid AND scholarship.scholarshipid = $id ");
$retval = mysql_query($getdetails, $conn);
if(! $retval)
{
die('Could not get data: ' . mysql_error());
}
?>
该ID是从获得theurl.php?id = IDNUMBER但事实证明,它无法获取数据。如何从PHP中的ID号码指定的行中获取数据?
当然你需要先取它。并停止使用mysql函数,并使用mysqli或PDO与准备语句来代替。 – Ghost 2014-11-23 07:01:33
我删除了'mysql_query',它可以工作。谢谢! – vinc 2014-11-23 07:38:30