Jump to content


Photo

Very puzzling...


  • Please log in to reply
2 replies to this topic

#1 korrupt_23

korrupt_23
  • Members
  • PipPip
  • Member
  • 13 posts

Posted 03 December 2003 - 05:27 AM

Hmm, well, I\'m really not sure why this coding isn\'t working.. and I\'m usually fair with mySQL.. but.. here goes..

Please tell me if you see anything wrong, even the smallest thing wrong in this code. The problem is it doesn\'t LIMIT to 5, only 1...

<?@include("connect2.php");$sql = "SELECT * FROM clicks ORDER BY \'unique\' DESC LIMIT 5";$result = mysql_query($sql);$number = mysql_numrows($result);$i = 0;$name = mysql_result($result,$i, "pagename");$clicks = mysql_result($result,$i, "raw");$unique = mysql_result($result,$i, "unique");echo "<TR><TD WIDTH="40%" ALIGN="CENTER">$name</TD><TD WIDTH="25%" ALIGN="CENTER">$unique</TD><TD WIDTH="30%" ALIGN="CENTER">Download</TD></TR>";$i++;?>

Anything? Or any ideas? Thanks very much..
KoRRupt

#2 triphis

triphis
  • Members
  • PipPipPip
  • Advanced Member
  • 62 posts

Posted 03 December 2003 - 05:37 AM

2 things. try mysql_num_rows ... I always do it that way :S

And for LIMIT, you can have 2 numbers. it goes LIMIT x,y

x = where you start
y = how many max

So for the first 5, go

LIMIT 0,5

for 10-15

LIMIT 10,5

etc...

Hope you find the problem :)
Xac Attack

#3 korrupt_23

korrupt_23
  • Members
  • PipPip
  • Member
  • 13 posts

Posted 03 December 2003 - 05:45 AM

Thanks man, and I do know about the 0,5, but 5 does work the same..

And yes, I did get it fixed, but I don\'t know how.. I changed too many things at once :oops:

Thanks again for trying man!
KoRRupt




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users