Hi,
I can't solve this problem:
I have a query which fetches the contents of the page meta tags from a database. It works fine when I have the query on page but when I turn it into a function (which is placed in my functions file) and call it from the page it does not work. Here is the code:
function get_meta_keywords() {
$q = "SELECT meta_tags FROM biology_notes WHERE section='2.1-cell-theory'";
$r = @mysqli_query($dbc, $q);
$row = mysqli_fetch_array($r, MYSQLI_ASSOC);
$meta_keywords = $row['meta_tags'];
return $meta_keywords;
}
When I use it in this way I get the following error:
Warning: mysqli_fetch_array() expects parameter 1 to be mysqli_result, null given in /Users/oscarconiel/Sites/IB_guides/includes/page_setup_functions.php on line 33
Anyone know why it doesn't work?
Thanks