2013-08-30

Hello i am new to PHP and i have been working on a project recently. I have made substantial progress by watching youtube tutorials however, this problem has come up.

I keep getting this error: Warning: mysql_num_rows(): supplied argument is not a valid MySQL result resource
I have been trying to create the admin panel for my web project

Please aid me in tackling this problem and big thanks in advance

Here is the code, the error is on line 33:

For your convenience here is the code around line 33:
//Grabs the whole question list

Remaining code

query("SELECT qQuestionNo FROM DebateQuestion WHERE
question='$question'LIMIT 1"); $questionMatch = mysql_num_rows($sql);
//count the output amount if ($questionMatch>0){ echo 'Sory you tried
to place a duplicate "Question" into the table, Click here'; exit(); } //Add the question to
the database $sql = $mysqli->query("INSERT INTO DebateQuestion
(qQuestion, qDebateVenue, qDate) VALUES('$question','$venue','$date'")
or die (mysql_error()); } ?> query("SELECT * FROM
DebateQuestion"); $questionCount = mysql_num_rows($sql);// count the
output amount

if($questionCount>0){ while($row = mysql_fetch_array($sql)){ $id =
$row["qQuestionNo"]; $question = $row["qQuestion"]; $venue =
$row["qDebateVenue"]; $date = $row["qDate"]; $question_list = "$id.
$question   Edit •Delete
"; } }else{ $question_list = "There are no
questions in the inventory yet"; }

?>

Show more