Warning: mysql_fetch_row(): supplied argument is not a valid MySQL result resource in tag.php

Asked by Peter

It displayed another similar error when there were no tags (mysql_fetch_row(): supplied argument is not a valid MySQL result resource in /path-to-jisko/includes/sidebar.php on line 192).

After I added a test tag, I get: mysql_fetch_row(): supplied argument is not a valid MySQL result resource in /path-to-jisko/pages/tag.php on line 41

Using PHP 5.2.8 & MySQL 4.1.10 < is this the problem?

Edit:

From log:

[MYSQL -- Monday 28th December 2009 11:21:05 PM]
Invalid use of group function
[MYSQL -- Monday 28th December 2009 11:21:05 PM]
Invalid use of group function

which is this query

SELECT `tag`, COUNT(`id`) FROM tags_n WHERE (UNIX_TIMESTAMP() - `timestamp`) < 86400 GROUP BY `tag` ORDER BY COUNT(`id`) DESC LIMIT 5

Question information

Language:
English Edit question
Status:
Solved
For:
Jisko Edit question
Assignee:
No assignee Edit question
Solved by:
Peter
Solved:
Last query:
Last reply:
Revision history for this message
Peter (peter-laws-p) said :
#1

Fixed it, well them:

in tag.php i changed all queries to:

SELECT `tag`, COUNT(`id`) AS tot FROM tags_n WHERE (UNIX_TIMESTAMP() - `timestamp`) < 18144000 GROUP BY `tag` ORDER BY tot DESC LIMIT 5

i.e. COUNT(`id`) AS tot......then order by tot

thing is... this query is flagging too:

SELECT t2.tag, t1.name, (UNIX_TIMESTAMP() - t1.timestamp) as `timestamp`, COUNT(t2.id) as `count`, ROUND((COUNT(t2.id)/(UNIX_TIMESTAMP() - t1.timestamp))*60, 2) as `calc` FROM `tags_c` AS t1, `tags_n` AS t2 WHERE t1.name = t2.tag GROUP BY t2.tag ORDER BY `calc` DESC LIMIT 5

error: Illegal mix of collations (utf8_unicode_ci,IMPLICIT) and (utf8_general_ci,IMPLICIT) for operation '='

Revision history for this message
Peter (peter-laws-p) said :
#2

Fixed it.......

maybve this will help others who have this issue......

Revision history for this message
Marcos Garcia (marcosgdf) said :
#3

Thanks for your help! :)

How did you fix the 2nd query?

Regards, Marcos

Revision history for this message
Peter (peter-laws-p) said :
#4

The problem was like it said 'mixed collations' on fields, so I just changed everything to 'utf8_general_ci'

Revision history for this message
Marcos Garcia (marcosgdf) said :
#5

Fixed the problem with the encoding in the last revision #71 / revision #5