当我运行此代码时,它会很好地返回主题...
$query = mysql_query("SELECT topic
FROM question
WHERE id = '$id'");
if(mysql_num_rows($query) > 0) {
$row = mysql_fetch_array($query) or die(mysql_error());
$topic = $row['topic'];
}
但是当我把它改成这个时,它根本不运行。为什么会这样?
$query = mysql_query("SELECT topic, lock
FROM question
WHERE id = '$id'");
if(mysql_num_rows($query) > 0) {
$row = mysql_fetch_array($query) or die(mysql_error());
$topic = $row['topic'];
$lockedThread = $row['lock'];
echo "here: " . $lockedThread;
}