Jump to ContentJump to Navigation/Login
` ` ` ` ` `

[Register]

Occasional ATutor release updates


No Members Logged In

(7 guests in past 15 min.)

Access Understanding Web Accessibility to learn about accessibility, or Register to take the course for FREE.

Support Forums

Development Forum

mysql_fetch_assoc(): supplied argument is not a valid MySQL result resource


You must be signed-in to post.

AuthorSubject
  Page: 1
bijita
final_test_new.php

Attachment: final_test_new.php
Subject: mysql_fetch_assoc(): supplied argument is not a valid MySQL result resourceQuote this post in your reply
i m working on an online quiz application....where i m tryng to restrict a user frm reappear for an exam.....
whn i trie to run the code i get an error...mysql_fetch_assoc(): supplied argument is not a valid MySQL result resource...unable to find out the reason....tried to check whether the connection is fine or not...as per my knowledge its working fine.....someone plsssss help me out.....
Posted: 2006-07-26 00:30:13
greg

Avatar for greg
Subject: Re: mysql_fetch_assoc(): supplied argument is not a valid MySQL result resourceQuote this post in your reply
This does not appear to have anything to do with ATutor. Perhaps you want to pose your question to a php help site.
Posted: 2006-07-26 08:30:41
LangJo5
Subject: Re: mysql_fetch_assoc(): supplied argument is not a valid MySQL result resourceQuote this post in your reply
I have no answer, but a similar problem.
Starting the ATutor I geht the Warning: mysql_fetch_assoc() is not a valid MySQL result resource. Problem at: ...ATutor/include/lib/output.inc.php line 268.

My operating system: windows Vista
Server: SH Server, DEprofessional p001.hostpoint.ch
ATutor version: 1.6.3
PHP: 5.2.11
MySQL: 5.1.33

Copie of Warning message:
Warning: mysql_fetch_assoc(): supplied argument is not a valid MySQL result resource in /home/paarbera/public_html/ATutor/include/lib/output.inc.php on line 268
(appears when I start the program)

Web browser: Moziall Firefox 3.5.5

I upgraded from Version 1.6.1 to 1.6.3. Before I had no problem.
Thank a lot, if anybody can help me.
Posted: 2009-11-29 04:55:23
greg

Avatar for greg
Subject: Re: mysql_fetch_assoc(): supplied argument is not a valid MySQL result resourceQuote this post in your reply
Did you upload the new version file by file, or as a single tar.gz file, then in pack that file on the server?

If the former, that's likely the problem. It sounds like corrupted files.

ATutor is untested with SH server. We recommend using Apache.
Posted: 2009-11-29 08:56:05
LangJo5
Subject: Re: mysql_fetch_assoc(): supplied argument is not a valid MySQL result resourceQuote this post in your reply
Thank you greg for the fast answer. I had uploaded file by file and did it now as a pack again. But the 'Warning' still goes on. Otherwise I can not see any malfunction till now, but the Warning is disturbing the users.

The text of lines 264-271 of the file ATutor/include/lib/output.inc.php is as follows:

/* get $_template from the DB */

$sql = "SELECT L.* FROM ".TABLE_PREFIX."language_text L, ".TABLE_PREFIX."language_pages P WHERE L.language_code='{$_SESSION['lang']}' AND L.variable<>'_msgs' AND L.term=P.term AND P.page='$_rel_url' ORDER BY L.variable ASC";
$result = mysql_query($sql, $db);
while ($row = mysql_fetch_assoc($result)) {
//Do not overwrite the variable that existed in the cache_template already.
//The edited terms (_c_template) will always be at the top of the resultset
//0003279

Till Friday everything worked fine with ATutor 1.6.1.
Should I better go back to this version?

Thank you. Joe
Posted: 2009-11-29 12:15:33
greg

Avatar for greg
Subject: Re: mysql_fetch_assoc(): supplied argument is not a valid MySQL result resourceQuote this post in your reply
Check the requirement to be sure your systems does not need upgrading to support the new version.
www.atutor.ca/atutor/docs/requirements.php

Are you able to run a fresh install of 1.6.3 along side your existing installation? Perhaps the database update was not complete.

You may be able to add an "@" to the @mysql_query or @mysql_fetch_assoc fundtions to suppress the error message.
Posted: 2009-11-29 12:33:45
LangJo5
Subject: Re: mysql_fetch_assoc(): supplied argument is not a valid MySQL result resourceQuote this post in your reply
Great, greg
to add "@" to 'mysql_fetch_assoc....' in line 268 is the solution.
I am so glad that I could get your help, thank you very much.
Joe
Posted: 2009-11-29 14:00:40
bigdaddy052678
Subject: Re: mysql_fetch_assoc(): supplied argument is not a valid MySQL result resourceQuote this post in your reply
Greg, you are the man! I had that same problem, it didn't affect any functionality, but it was annoying to have at the top of the program.

I added the @ to two places you mentioned. Note: If you add to only one you will have an error.

Line 267 and 268
$result = @mysql_query($sql, $db);
while ($row = @mysql_fetch_assoc($result)) {

Big Thanks!
Posted: 2010-02-02 23:28:57
 Page: 1

You must be signed-in to post.