我对 php 和 MySQL 有点陌生。当我调用下面的函数时,我正在阅读教程并收到上述消息。
<?php
function get_subject_by_id($subject_id){
global $connection;
$query = "SELECT * FROM subjects WHERE id=" . $subject_id . "LIMIT 1";
$result_set = mysql_query($query, $connection);
confirm_query($result_set);
//if no rowes are returned, fetch array will return false
if ($subject = mysql_fetch_array($result_set)) {
return $subject;
} else {
return NULL;
}
}
?>