I need help with this error, please!
Posted: Sun Jan 25, 2009 6:03 pm
I've been designing a site for about 2 days now.
Everything was working fine until I put this NECESSARY code in
Everything was working fine until I put this NECESSARY code in
and it returned this error (I'm running on localhost)function get_subject_by_id($subject_id) {
global $connect;
$query = "SELECT * ";
$query .= "FROM subjects ";
$query .= "WHERE id=" . $subject_id ." ";
$query .= "LIMIT 1";
$result_set = mysql_query($query, $connect);
confirm_query($result_set);
if ($subject = mysql_fetch_array($result_set)) {
return $subject;
} else {
return NULL;
}
}
Database query failed: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'LIMIT 1' at line 1