Webmastersite.net
Register Log In

MSQL ERROR

Comments on MSQL ERROR

babrees
Expert

Usergroup: Customer
Joined: Aug 19, 2005
Location: England

Total Topics: 391
Total Comments: 1303
babrees
Posted Dec 24, 2005 - 1:55 AM:

Hi Paul, Bearing in mind it is Christmas Eve, I don't expect you'll see this until next week, so I'd like to first say that I hope you had a nice relaxing Christmas!

I'm setting up a new site (http://www.thehorsescene.co.uk/articles) with TWO wsn links and ONE wsn forum, none integrated, all using same database (wsn_links, wsn_forum, wsn_articles)

At one of the links (articles) I have started getting the error: Warning: mysql_num_rows(): supplied argument is not a valid MySQL result resource in /home/thehorse/public_html/articles/classes/database.php on line 108

This is not appearing on the other links or forum. debug shows...

Load time so far: 0.11 seconds.
Performing query: SELECT id FROM wsnarticles_categories WHERE validated=1 AND hide=0 AND isalbum=0 ORDER BY id DESC LIMIT 0,1;


Load time so far: 0.12 seconds.
Performing query: SELECT name,value FROM wsnarticles_switches WHERE id>0 ;


Number of rows is 57 for Resource id #37

Load time so far: 0.12 seconds.
Performing query: SELECT id,title,caneditown,caneditall,canvote,isadmin,canpost,canemail,validatecats,validatecomments,validatelinks,validateedits,cansubmitlinks,cansubmitcategories,cansubmitcomments,caneditownlinks,caneditowncategories,caneditowncomments,caneditownprofile,caneditalllinks,caneditallcategories,caneditallcomments,caneditallprofiles,candownloadfiles,canupload,canviewip,limitlinks,canemailmembers,canusehtml,limitlinksdaily,canalias,cancopy,candeleteown,candeleteall,candofulledit,candeletecategories,candeletecomments,candeleteowncategories,candeleteowncomments,candeletemembers,candeleteownmembers,canaliascategories,canviewpages,caneditvotes,numaliases,canviewvotes,canhideownlinks,canhideowncategories,canhideowncomments,canhidealllinks,canhideallcategories,canhideallcomments,canratecomments,bytespermem,canpm,canim,canharddelete,limitpms,limitpmsdaily,canviewdeleted,cansubmitpolls,candeletepolls,candeleteownpolls,caneditpolls,caneditownpolls,attachperpost,attachperpm,canviewshouts,caneditshouts,caneditownshouts,candeleteshouts,candeleteownshouts,cansubmitshouts,canpollvote,customtitle,canviewinvisible,namestyle,canpmimportant,canviewmodlog,isleader,cansubmitquotes,validatequotes,candeletequotes,candeleteownquotes,canreport,canusesearch,attachperlink,validateattachments,caneditownquotes,caneditallquotes,canviewchat,caneditownevents,caneditallevents,candeleteownevents,candeleteevents,cansubmitevents,validateevents,bulkpms,issupermod FROM wsnarticles_membergroups WHERE id>0 ;


Load time so far: 0.13 seconds.
Performing query: SELECT id,name,links,comments,time,usergroup,password,ip,totalhits,totalhitsin,email,validated,template,language,lastattempt,allowemail,signature,avatarname,stylesheet,allowuseremail,albumid,failedattempts,totalbytes,funds,notifyoflinks,lastvisit,timezone,rating,pmfolders,notifyofpms,acceptpms,cookieduration,banned,location,homepage,occupation,bio,aim,icq,msn,yahoo,inactive,timeonline,totalpms,buddies,ignored,isonline,acceptims,adminpermissions,referrer,groupreverttime,grouprevertto,moderationpm,secondarygroups,linksperpage,commentsperpage,shouts,customtitle,shoutban,topicbans,forumbans,visibility,birthdate,lastsession,interests,posteditor,forumaccess,pmpopup,pmnotify,modnotes,guestnotes,salt,lastmodnote,newpms,imflag,orderalbums,lastguestnote,autosubscribe,notifymethod,showavatars,showsigs,warninglevel,topics,posts,chatcolor FROM wsnarticles_members WHERE id=1 AND validated=1 ;


Load time so far: 0.13 seconds.
Performing query: SELECT id,name,parent,validated,description,time,parentnames,parentids,numlinks,hide,lastlinktime,custom,lastedit,moderators,headerinfo,related,numsub,type,permissions,subscribers,subscriber,mixtypes,isalbum,orderlinks,totalcomments,ulsearchmax,ulsearchquery,ulsearchadult,alias,catcols,linkcols,dmozpath,sponsorlinks,views,customwrap,deleted,reqlinks,reqcoms,reqlinksdelay,priority,levelsdeep,lastposterid,lastpostername,lastcommenttime,lastthreadid,lastthreadtitle,linkshere,unvalidatedlinks,unvalidatedcomments,actaslink,countposts,subcatshtml FROM wsnarticles_categories WHERE validated=1 AND deleted=0 AND hide=0 ;


Number of rows is 0 for Resource id #44

Load time so far: 0.13 seconds.
Performing query: LOCK TABLES wsnarticles_email WRITE, wsnarticles_links WRITE, wsnarticles_categories WRITE, wsnarticles_members WRITE;


Load time so far: 0.13 seconds.
Performing query: SELECT id,`to`,subject,message,headers,replacement,mime FROM wsnarticles_email WHERE timesent=0 ORDER BY id ASC LIMIT 0,10;


Number of rows is 0 for Resource id #45

Load time so far: 0.13 seconds.
Performing query: UNLOCK TABLES;


Load time so far: 0.14 seconds.
Performing query: SELECT id,frequency,filename,nextrun FROM wsnarticles_crons WHERE nextrun < 1135409497 ORDER BY id ASC LIMIT 0,1;


Number of rows is 0 for Resource id #47

Load time so far: 0.14 seconds.
Performing query: SELECT id,name,parent,validated,description,time,parentnames,parentids,numlinks,hide,lastlinktime,custom,lastedit,moderators,headerinfo,related,numsub,type,permissions,subscribers,subscriber,mixtypes,isalbum,orderlinks,totalcomments,ulsearchmax,ulsearchquery,ulsearchadult,alias,catcols,linkcols,dmozpath,sponsorlinks,views,customwrap,deleted,reqlinks,reqcoms,reqlinksdelay,priority,levelsdeep,lastposterid,lastpostername,lastcommenttime,lastthreadid,lastthreadtitle,linkshere,unvalidatedlinks,unvalidatedcomments,actaslink,countposts,subcatshtml FROM wsnarticles_categories WHERE parent=0 AND validated=1 AND hide=0 AND isalbum=0 AND deleted=0 ORDER BY priority ASC,name ASC LIMIT 0,40;


Number of rows is 0 for Resource id #49

Load time so far: 0.14 seconds.
Performing query: SELECT id FROM wsnarticles_categories WHERE parent=0 AND validated=1 AND hide=0 AND deleted=0 ;


Number of rows is 0 for Resource id #50

Setting cookie with name returnto, value http://www.thehorsescene.co.uk/articles/index.php and duration 1135410397


Warning: Cannot modify header information - headers already sent by (output started at /home/thehorse/public_html/articles/classes/database.php:276) in /home/thehorse/public_html/articles/commonfuncs.php on line 442

Warning: Cannot modify header information - headers already sent by (output started at /home/thehorse/public_html/articles/classes/database.php:276) in /home/thehorse/public_html/articles/commonfuncs.php on line 446

Warning: Cannot modify header information - headers already sent by (output started at /home/thehorse/public_html/articles/classes/database.php:276) in /home/thehorse/public_html/articles/end.php on line 142

Load time so far: 0.14 seconds.
Performing query: SELECT COUNT(id) FROM wsnarticles_sessions WHERE memberid>0 ;


Count is 1

Load time so far: 0.14 seconds.
Performing query: SELECT COUNT(id) FROM wsnarticles_sessions WHERE memberid=0 AND isrobot=0 ;


Count is 0

Load time so far: 0.14 seconds.
Performing query: SELECT COUNT(id) FROM wsnarticles_sessions WHERE memberid=0 AND isrobot=1 ;


Count is 0

Load time so far: 0.15 seconds.
Performing query: UPDATE wsnarticles_settings SET content=Ƈ, 1135409497' WHERE name='onlinemembersmax'


Load time so far: 0.15 seconds.
Performing query: UPDATE wsnarticles_settings SET content=Ƈ, 1135409497' WHERE name='onlinetotalmax'


Load time so far: 0.17 seconds.
Performing query: SELECT FROM

linkstable WHERE validated=1 ORDER BY id DESC LIMIT 0,5;



Warning: mysql_num_rows(): supplied argument is not a valid MySQL result resource in /home/thehorse/public_html/articles/classes/database.php on line 108

Number of rows is for You have an error in your SQL syntax. Check the manual that corresponds to your MySQL server version for the right syntax to use near 'FROM

linkstable WHERE validated=1 ORDER BY

Load time so far: 0.17 seconds.
Performing query: SELECT id,memberid,location,time,ip,browser,starttime,catid,threadid,areaname,lastsearch,nopermission,inchat,name,isrobot,lastchat FROM wsnarticles_sessions WHERE time > 1135408597 AND (memberid>0) ORDER BY time DESC LIMIT 0,100;

You have an error in your SQL syntax. Check the manual that corresponds to your MySQL server version for the right syntax to use near 'FROM

linkstable WHERE validated=1 ORDER BY

Number of rows is 1 for Resource id #55

Load time so far: 0.18 seconds.
Performing query: SELECT id,name,links,comments,time,usergroup,password,ip,totalhits,totalhitsin,email,validated,template,language,lastattempt,allowemail,signature,avatarname,stylesheet,allowuseremail,albumid,failedattempts,totalbytes,funds,notifyoflinks,lastvisit,timezone,rating,pmfolders,notifyofpms,acceptpms,cookieduration,banned,location,homepage,occupation,bio,aim,icq,msn,yahoo,inactive,timeonline,totalpms,buddies,ignored,isonline,acceptims,adminpermissions,referrer,groupreverttime,grouprevertto,moderationpm,secondarygroups,linksperpage,commentsperpage,shouts,customtitle,shoutban,topicbans,forumbans,visibility,birthdate,lastsession,interests,posteditor,forumaccess,pmpopup,pmnotify,modnotes,guestnotes,salt,lastmodnote,newpms,imflag,orderalbums,lastguestnote,autosubscribe,notifymethod,showavatars,showsigs,warninglevel,topics,posts,chatcolor FROM wsnarticles_members WHERE id=1 ;


Load time so far: 0.18 seconds.
Performing query: SELECT id,name,links,comments,time,usergroup,password,ip,totalhits,totalhitsin,email,validated,template,language,lastattempt,allowemail,signature,avatarname,stylesheet,allowuseremail,albumid,failedattempts,totalbytes,funds,notifyoflinks,lastvisit,timezone,rating,pmfolders,notifyofpms,acceptpms,cookieduration,banned,location,homepage,occupation,bio,aim,icq,msn,yahoo,inactive,timeonline,totalpms,buddies,ignored,isonline,acceptims,adminpermissions,referrer,groupreverttime,grouprevertto,moderationpm,secondarygroups,linksperpage,commentsperpage,shouts,customtitle,shoutban,topicbans,forumbans,visibility,birthdate,lastsession,interests,posteditor,forumaccess,pmpopup,pmnotify,modnotes,guestnotes,salt,lastmodnote,newpms,imflag,orderalbums,lastguestnote,autosubscribe,notifymethod,showavatars,showsigs,warninglevel,topics,posts,chatcolor FROM wsnarticles_members WHERE id=1 ;

In case they're handy, my environment stats are...

PHP Version: 4.4.0
Zend Engine Version: 1.3.0
Loaded PHP Extensions: zip xslt xmlrpc xml wddx tokenizer standard sockets session posix pcre overload mysql mhash mcrypt mbstring imap gettext gd ftp exif domxml curl ctype calendar bcmath zlib openssl

MySQL Version: 4.0.25-standard
MySQL Stats: Uptime: 213925 Threads: 5 Questions: 15174248 Slow queries: 70 Opens: 2210428 Flush tables: 1 Open tables: 64 Queries per second avg: 70.933

------
This is not the first time I have seen Warning: mysql_num_rows(): supplied argument is not a valid MySQL result resource in /home/thehorse/public_html/articles/classes/database.php on line 108 (see 4 Dec post at https://www.webmastersite.net/forums/comments.php?... )

I have since moved that site and new site to a new host, but this morning I saw the error on that site (http://www.thedogscene.co.uk) once again, refreshed and it disappeared.



babrees
Expert

Usergroup: Customer
Joined: Aug 19, 2005
Location: England

Total Topics: 391
Total Comments: 1303
babrees
Posted Dec 24, 2005 - 2:12 PM:

ok - I THINK I may have got this corrected. Am currently working on it and it appears to be ok at the moment.

Out of curiosity I installed a new database and wsn links in a separate directory. The only thing that wasn't new were my templates. The problem showed itself again! So I reinstalled the original templates and it was ok! Am now installing my templates one by one. I found that when I reinstalled my main.tpl the problem reappeared, so I have re-written that one from scratch and at the moment it appears to be fine.

I have no idea what or where the problem was, but who cares - it's working <G>



MERRY CHRISTMAS!!!nod
Paul
developer

Usergroup: Administrator
Joined: Dec 20, 2001
Location: Diamond Springs, California

Total Topics: 61
Total Comments: 7868
Paul
Posted Dec 24, 2005 - 11:18 PM:

Well the problem was that it tried to do a "SELECT FROM linkstable WHERE validated=1 ORDER BY id DESC LIMIT 0,5;" query without replacing linkstable with the actual name of your links table (wsnarticles_links). The nature of the query suggests it's from a toplist? Must've been something strange involving a toplist in main.tpl.

Merry Christmas to you as well.
Search thread for
Download thread as
  • 0/5
  • 1
  • 2
  • 3
  • 4
  • 5



This thread is closed, so you cannot post a reply.