Strange mysql_fetch_array() Problem
Posted: Mon Feb 25, 2008 5:43 pm
I've just been messing around with some code and decided to start making a kind of template system that reads from the database. I am using this little bit of code:
However it is constantly returning this error:
Code: Select all
<?php
mysql_connect("localhost","root","");
mysql_select_db("data");
$getTmp = mysql_query("SELECT template FROM ".$dbprefix."templates WHERE title = 'header' LIMIT 1");
$getTemp = mysql_fetch_array($getTmp);
$template = $getTemp['template'];
return $template;
?>I'm probably being blind or something, but I cannot seem to find what is wrong, anyone care to point it out?Warning: mysql_fetch_array(): supplied argument is not a valid MySQL result resource in C:\AppServ\www\index.php on line 5