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