Community Forums

ATutor Bug Reports

Deleting test records


You must be signed-in to post.

AuthorSubject
 
Page: 1
hcameron
Subject: Deleting test recordsQuote this post in your reply
I am coming up with the error when I try and delete a test record -
Warning: mysql_fetch_array(): supplied argument is not a valid MySQL result resource in /home/intellip/public_html/tools/tests/delete_result.php on line 29

Hugh Cameron

Database:
3.07 MB
Disk Usage:
123.26 MB
Courses:
15
Users:
197
ATutor Version:
1.6.2. Check Latest Version.
PHP Version:
4.4.7
MySQL Version:
4.1.22-standard-log
OS:
Linux 2.6.28.5-grsec-sg2
Posted: 2009-03-24 10:14:20
IndieRect

Avatar for IndieRect
Subject: Re: Deleting test recordsQuote this post in your reply
Hi,

I guess it may be a JOIN compatibility issue (though the MySQL manuals for 4.1 and 5.0+ seem to be in agreement).

You could try replacing line 27 of file /home/intellip/public_html/tools/tests/delete_result.php , this one:
$sql = "SELECT COUNT(*) AS cnt FROM ".TABLE_PREFIX."tests_results LEFT JOIN ".TABLE_PREFIX."tests USING (test_id) WHERE result_id IN ($rid) AND course_id = $_SESSION[course_id] AND test_id = $tid";


with the following one:

$sql = "SELECT COUNT(*) AS cnt FROM ".TABLE_PREFIX."tests_results LEFT JOIN ".TABLE_PREFIX."tests USING (test_id) WHERE result_id IN ($rid) AND course_id = $_SESSION[course_id] AND ".TABLE_PREFIX."tests.test_id = $tid";

Please write back whether it works.
Posted: 2009-03-24 10:36:29
hcameron
Subject: Re: Deleting test recordsQuote this post in your reply
That worked! Thank you.
Posted: 2009-03-28 19:36:49
IndieRect

Avatar for IndieRect
Subject: Re: Deleting test recordsQuote this post in your reply
Thank you, Hugh. I wish more reports were as detailed as yours, enough to find and fix a bug in mere minutes.
Posted: 2009-03-29 02:58:48
 
Page: 1

You must be signed-in to post.

Related Articles