Hello.
I have the following errors:
Warning: mysql_fetch_array(): supplied argument is not a valid MySQL result resource in /home/winnie/public_html/pqQuiz/lib/templates.php on line 13
Warning: mysql_fetch_array(): supplied argument is not a valid MySQL result resource in /home/winnie/public_html/pqQuiz/lib/templates.php on line 13
Warning: mysql_fetch_array(): supplied argument is not a valid MySQL result resource in /home/winnie/public_html/pqQuiz/lib/templates.php on line 13
Lines 1-16 of templates.php shows the following:
function loadTemplates() {
global $templates;
if( !isset($_SESSION['user']) || $_SESSION['user'] == "" ){
$selected = "templates";
}
else{
$selected = mysql_fetch_array(mysql_query("SELECT * FROM users WHERE user='".$_SESSION['user']."'"));
$selected = $selected['template'];
}
$loadTemplates = mysql_query("SELECT * FROM $selected");
while($loadTemplates = mysql_fetch_array($loadTemplates)){
$templates[$loadTemplates['name']] = $loadTemplates['code'];
}
}
Could anyone help me solve this problem?
Thanks :)