Jump to content
php.lv forumi

confirm_query


figa

Recommended Posts

Nevaru saprast

<?

function get_subject_by_id($subject_id) {

global $connection;

$query = "select * ";

$query .= "From subjects ";

$query .= "Where id=" . $subject_id;

$query .= " limit 1";

$result_set = mysql_query($query, $connection);

confirm_query($result_set);

if ($subject = mysql_fetch_array($result_set)) {

return $subject;

} else {

return NULL;

}

}

?>

Link to comment
Share on other sites

×
×
  • Create New...