Computer ForumsComputers  

Go Back   Computer Forums > The World Wide Web > Web Graphics, design, digital images

Reply
 
LinkBack Thread Tools Display Modes
Old 09-04-2006, 09:40 AM   #1 (permalink)
Newb Techie
 
Join Date: Dec 2005
Posts: 33
Default php/mysql question

I have a script for simple stat logging that i wrote. The only issue I have is seen in a few ways, the easiest to explain is as follows:

It will graph top five most used browsers on the site. However, if only three browsers are in the mysql table ($querystats="SELECT *,count(*) as hits FROM `statistics` group by browser order by hits desc limit 5", I get an error:

Warning: mysql_result() [function.mysql-result]: Unable to jump to row 3 on MySQL result index 4 in /roottofile/file.inc on line 8

Warning: mysql_result() [function.mysql-result]: Unable to jump to row 4 on MySQL result index 4 in /roottofile/file.inc on line 9

Warning: mysql_result() [function.mysql-result]: Unable to jump to row 3 on MySQL result index 4 in /roottofile/file.inc on line 39

Warning: mysql_result() [function.mysql-result]: Unable to jump to row 4 on MySQL result index 4 in /roottofile/file.inc on line 40

What can I put into the mysql command or php script to basically say "hey, if only three rows (or results) are returned, dont error out, just give me what you got and forget about the rest"?
MajorHertz is offline   Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



All times are GMT -5. The time now is 10:21 PM.


Powered by vBulletin® Version 3.7.1
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO 3.1.0