vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vBulletin 2.x Full Releases (https://vborg.vbsupport.ru/forumdisplay.php?f=4)
-   -   Member of the Day! (https://vborg.vbsupport.ru/showthread.php?t=34779)

Psychdrone 02-10-2002 10:19 PM

Quote:

Originally posted by FireFly
........If you want I can post the modified code here,.........
and thats why you are so cool :p , thanks for giving me a chance to figure it out on my own, I looked at it for about 10 menites but couldn't figure it out:(

But I am learning my friend, jsut at a slow pace (lots of other stuff going on in life) I shall amaze you one day:)

cditty 02-10-2002 11:11 PM

It looks like the Order by RAND() function is not available for mysql versions 3.22 or lower. Any way of getting the sql rewritten to work with 3.22? :)

Thanks

Chris

Admin 02-11-2002 09:04 AM

What version is your MySQL? I know that the ability to order by RAND() was only added in a certain version... I'll dig up see if I can find the older way to get a random row. :)

cditty 02-11-2002 01:46 PM

I'm running 3.22.32. I looked and the order by rand() does only seem to be available to 3.23 and up.

I am trying to talk myself into upgrading the mysql version, but I'm chicken.

Admin 02-11-2002 04:29 PM

Ok my book tells me you should change the query to this:
PHP Code:

    $newmember=$DB_site->query_first("SELECT userid,username,userid*0+RAND() AS randNum
                                        FROM user
                                       WHERE userid<>
$daybits[1]
                                         AND (usergroupid=5
                                          OR usergroupid=6
                                          OR usergroupid=7
                                          OR usergroupid=2)
                                       ORDER BY randNum
                                       LIMIT 1"
); 


cditty 02-11-2002 06:04 PM

Works like a champ. Thanks.

Chris

Psychdrone 02-11-2002 11:35 PM

firefly?

Admin 02-12-2002 09:56 AM

Right, sorry. :)

Just change first line of code to this:
Code:

$thisdate=date('W');
And I think you're done.

over 02-13-2002 10:50 AM

thanks gonna try this 1 out :)

Massiel 02-14-2002 01:07 AM

How do you run a query? I am new at this, you lost me hehe


All times are GMT. The time now is 07:57 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.01156 seconds
  • Memory Usage 1,739KB
  • 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_code_printable
  • (1)bbcode_php_printable
  • (1)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (4)pagenav_pagelink
  • (1)pagenav_pagelinkrel
  • (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