I have been working on this problem for a few weeks now and everything I have tried will not work. I am new to working with PHP and MySQL and have never use a forum, so you can say I am new to everything right now.
When I try to load the page in the web browser, I get this error message:
Warning: mysql_query(): supplied argument is not a valid MySQL-Link resource in /Users/herkinsfrancois/Sites/divine_endings/inculudes/function.php on line 33
Database query failed:
Here is the function I have been using and line 33 is the line in red.
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);
// REMEMBER:
// if no rows are returned, fetch_array will return false
if ($subject = mysql_fetch_array($result_set)) {
return $subject;
} else {
return NULL;
}
}
Any suggestions or feedback would be greatly appreciated!
-HFK