vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vB3 Programming Discussions (https://vborg.vbsupport.ru/forumdisplay.php?f=15)
-   -   Limiting in mySQL (https://vborg.vbsupport.ru/showthread.php?t=44582)

DrkFusion 10-13-2002 05:27 PM

Limiting in mySQL
 
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

Quote:

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:
PHP Code:

$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
[sql]$DB_site->query("SELECT * FROM thread LIMIT 51,100");[/sql]
?

-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

[sql]$DB_site->query_first("SELECT * FROM thread LIMIT 51,100");[/sql]

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

Quote:

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

Quote:

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

Quote:

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 ;)


All times are GMT. The time now is 06:56 AM.

Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.

X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.01072 seconds
  • Memory Usage 1,737KB
  • Queries Executed 10 (?)
More Information
Template Usage:
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (1)bbcode_php_printable
  • (4)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (14)printthreadbit
  • (1)spacer_close
  • (1)spacer_open 

Phrase Groups Available:
  • global
  • postbit
  • showthread
Included Files:
  • ./printthread.php
  • ./global.php
  • ./includes/init.php
  • ./includes/class_core.php
  • ./includes/config.php
  • ./includes/functions.php
  • ./includes/class_hook.php
  • ./includes/modsystem_functions.php
  • ./includes/class_bbcode_alt.php
  • ./includes/class_bbcode.php
  • ./includes/functions_bigthree.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • printthread_start
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete