I am using the following script to try and count the rows in a table, the problem I keep getting is the error :
Query was empty Quiz Name
and a blank page. Im new to COUNT, so I think I might be making a mess of it :-S . My database layout is as follows :
itsnb_chronoforms_data_createquestions cf_id ,cf_uid,cf_created ,cf_modified, cf_ipaddress, cf_user_id, quizID, questionID, quizquestion, quizanswer1, quizanswer2, quizanswer3, quizanswer4, questionformat ,correctanswer
The script I am working on is :
// Define Quiz Variables
$quiz = $row['quizID'];
$quizcfid = $row['cf_id'];
$quizname = $row['quizname'];
// Finish Define Quiz Variables
///////////////////////////////////////////////////////////////////////////////////////////////
// Make a MySQL Connection
$query8 = "SELECT COUNT(*) as 'numberofquestions' FROM employees WHERE quizID='$quiz'";
$result8 = mysql_query($query) or die(mysql_error());
// Print out result
while($row8 = mysql_fetch_array($result8)){
echo 'There are '. $row8['COUNT(quizID)'] . ' questions';
}
///////////////////////////////////////////////////////////////////////////////////////////////