vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   Member Archives (https://vborg.vbsupport.ru/forumdisplay.php?f=202)
-   -   Query help (https://vborg.vbsupport.ru/showthread.php?t=49676)

geniuscrew 03-05-2003 12:32 PM

Query help
 
For The Ultimate Quote hack by Kurafire, the quotes are shown randomly using this query.

PHP Code:

// random quote hack by KuraFire
 
$quot=$DB_site->query_first("SELECT quote,name FROM quotes ORDER BY rand() LIMIT 1");
 
$thequote $quot['quote'];
 
$thequoter $quot['name']; 

how can I change it so it goes through all the quotes in order?

[They each have an id and ORDER BY id doesn't seem to be working :/]

Thanks

Boofo 03-05-2003 12:36 PM

Quote:

Originally posted by geniuscrew
For The Ultimate Quote hack by Kurafire, the quotes are shown randomly using this query.

PHP Code:

// random quote hack by KuraFire
 
$quot=$DB_site->query_first("SELECT quote,name FROM quotes ORDER BY rand() LIMIT 1");
 
$thequote $quot['quote'];
 
$thequoter $quot['name']; 

how can I change it so it goes through all the quotes in order?

[They each have an id and ORDER BY id doesn't seem to be working :/]

Thanks

I think it would be ORDER BY DESC LIMIT 1

geniuscrew 03-05-2003 12:41 PM

That gives an error. I tried ORDER BY id DESC - but now it just shows the last quote added

Boofo 03-05-2003 12:46 PM

Quote:

Originally posted by geniuscrew
That gives an error. I tried ORDER BY id DESC - but now it just shows the last quote added
Try this:

PHP Code:

ORDER BY quotesid desc LIMIT 1 


Boofo 03-05-2003 12:49 PM

If that doesn't work, maybe this will?

PHP Code:

ORDER BY quotes desc LIMIT 1 


geniuscrew 03-05-2003 12:49 PM

Still no luck - thanks anyway

Steve Machol 03-05-2003 07:15 PM

geniuscrew, to download hacks and get support you will need to go to this page and enter your email address, to show you are licensed. (you will need to use your customer number and password to access that page)
Thank you.

geniuscrew 03-05-2003 07:25 PM

sorry i just changed my email and fogot to update the thing -

Back on topic: can anyone help please?

Erwin 03-05-2003 07:49 PM

Take out the LIMIT 1 - that only limits it to 1 entry.

Boofo 03-05-2003 07:53 PM

I think they only want them to list 1 at a time but in order and not randomly, if I understood right, that is.


All times are GMT. The time now is 07:28 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.01112 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
  • (4)bbcode_php_printable
  • (2)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (2)pagenav_pagelink
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (10)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
  • pagenav_page
  • pagenav_complete
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete