尝试这个,
$uid = $_GET['id'];
echo $sql = "select * from notice where id=".$uid;
echo $result = mysql_query($sql);
if($result === FALSE) {
die(mysql_error()); // error handling
}
$row = mysql_fetch_array($result);
echo $row['headline'];
echo $row['description'];
echo $row['image'];
或者,
$uid = $_GET['id'];
echo $sql = "select * from notice where id=$uid";
echo $result = mysql_query($sql);
if($result) {
$row = mysql_fetch_array($result);
echo $row['headline'];
echo $row['description'];
echo $row['image'];
}
或者
$uid = $_GET['id'];
echo $sql = "select * from notice where id=$uid";
echo $result = mysql_query($sql) or die(mysql_error());
$row = mysql_fetch_array($result);
echo $row['headline'];
echo $row['description'];
echo $row['image'];
mysql 扩展也是从PHP 5.5.0deprecated
开始阅读http://www.php.net/manual/en/intro.mysql.php