Computer Forums

Member Login

Remember Me? Sign Up! | Forgot Password
 
Slogan
 
Closed Thread
Old 09-04-2006, 10:40 AM   #1 (permalink)
 
Newb Techie

Join Date: Dec 2005

Posts: 32

MajorHertz

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  
 
Closed Thread

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