I am having trouble with a page where i need to insert data into a SQL field. It comes up with this error 7 times:

Warning: mysql_num_rows(): supplied argument is not a valid MySQL result resource in /

i would post the actual php page but its over 1000 lines long so i have uploaded a text file.

http://www.danwhybrow.com/form.txt

If anyone could fix it i would be so grateful.

Thanks

Dan

Sorry to double post but here are the line numbers that it says:

on line 171
on line 381
on line 591
on line 799
on line 1007
on line 1215
on line 1423

Can you please give the exact error message please?
and are you sure the dbConfig.php is loaded correctly?

Warning: mysql_num_rows(): supplied argument is not a valid MySQL result resource in /home/dan/public_html/staff/timetable/form.php on line 169

Warning: mysql_num_rows(): supplied argument is not a valid MySQL result resource in /home/dan/public_html/staff/timetable/form.php on line 379

Warning: mysql_num_rows(): supplied argument is not a valid MySQL result resource in /home/dan/public_html/staff/timetable/form.php on line 589

Warning: mysql_num_rows(): supplied argument is not a valid MySQL result resource in /home/dan/public_html/staff/timetable/form.php on line 797

Warning: mysql_num_rows(): supplied argument is not a valid MySQL result resource in /home/dan/public_html/staff/timetable/form.php on line 1005

Warning: mysql_num_rows(): supplied argument is not a valid MySQL result resource in /home/dan/public_html/staff/timetable/form.php on line 1213

Warning: mysql_num_rows(): supplied argument is not a valid MySQL result resource in /home/dan/public_html/staff/timetable/form.php on line 1421

there are two pages the form.php and addperm.php

this is addperm.php

<?php

include ("dbConfig.php");

$day = $_POST['day'];

$time = $_POST['time'];

$name = $_POST['showname'];

$perm = $_POST['perm'];







if ($perm == 'perm'){

mysql_query("UPDATE perm$day SET $time='$name'");

mysql_query("UPDATE $day SET $time='$name'");

}

else{

mysql_query("UPDATE $day SET $time='$name'");

}



header ("Location: form.php?time=booked");

?>

Go over to the PHP forum and read the FAQ.

Can you give details of your database tables?

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.