View Full Version : Limiting in mySQL
DrkFusion
10-13-2002, 05:27 PM
Hi, how would I limit in mysql, like on the first page there would only be 50, then on the next 50-100 and so on?
Thanks
-Arunan
Chris M
10-13-2002, 06:00 PM
I would also like to know this:P
Satan
DrkFusion
10-13-2002, 06:16 PM
Originally posted by hellsatan
I would also like to know this:P
Satan
Liar you just want to make a screenshot of you being the last poster LOL :p
-Arunan
Chris M
10-13-2002, 06:27 PM
Possibly...But I am interested in learning anything and everything about PHP & MySQL:)
Satan
Velocd
10-13-2002, 07:16 PM
Fifty what? Threads? Posts?
The basic query is:
$DB_site->query("SELECT * FROM thread LIMIT 50");
That's ofcourse not the query to use, but you can see the LIMIT 50 part will retrieve 50 threads or whatever. If it's for each page, you'll have to check out the showthread.php and find the specific code to manipulate.
DrkFusion
10-13-2002, 08:10 PM
Well, like after the 50 is posted, how would i make it so on the next page, all the stuff from 51-100 are shown?
Is it something like
$DB_site->query("SELECT * FROM thread LIMIT 51,100");
?
-Arunan
NTLDR
10-13-2002, 08:14 PM
You got it noX :D
Should be $DB_site->query_first though I think ;)
DrkFusion
10-13-2002, 08:36 PM
So
$DB_site->query_first("SELECT * FROM thread LIMIT 51,100");
Thanks
-Arunan
NTLDR
10-13-2002, 08:40 PM
That looks good to me noX :D
DrkFusion
10-13-2002, 08:47 PM
Thanks NTLDR, thanks Velocd
Appreciate your continuted support here :)
-Arunan
NTLDR
10-13-2002, 08:49 PM
Your welcome Arunan, just giveing back what you have given to the community :D
DrkFusion
10-14-2002, 04:08 PM
Originally posted by NTLDR
Your welcome Arunan, just giveing back what you have given to the community :D
I hope to be giving much more to the community :)
-nOX
Xenon
10-14-2002, 04:57 PM
Originally posted by NTLDR
You got it noX :D
Should be $DB_site->query_first though I think ;)
sorry but wrong NTLDR, if he wants more that one row (i think 50 does he want ;)) he HAS to use just query and then create the whileloop with fetch_array :)
NTLDR
10-14-2002, 06:40 PM
Originally posted by Xenon
sorry but wrong NTLDR, if he wants more that one row (i think 50 does he want ;)) he HAS to use just query and then create the whileloop with fetch_array :)
Thanks for correcting me Xenon, I can never remember which to use untill I try and find it doesn't work ;)
vBulletin® v3.8.12 by vBS, Copyright ©2000-2025, vBulletin Solutions Inc.