Gossamer Forum
Quote Reply
random generator
Anybody know how good LSQL's random database selection is? If I have some category with 100 links and I want to pull x random links every two weeks, is it going to be truly random?
Quote Reply
Re: [scorpioncapital] random generator In reply to
In terms of what being random? If using RAND(), then this is a MySQL function ... but LSQL uses it. Or are you refering to the code in Jump.pm?

Cheers

Andy (mod)
andy@ultranerds.co.uk
Want to give me something back for my help? Please see my Amazon Wish List
GLinks ULTRA Package | GLinks ULTRA Package PRO
Links SQL Plugins | Website Design and SEO | UltraNerds | ULTRAGLobals Plugin | Pre-Made Template Sets | FREE GLinks Plugins!
Quote Reply
Re: [Andy] random generator In reply to
In terms of pulling 'n' random links from a category. I don't want it to return the answer in 'clumps' or be overly repetitive. The sample size we are dealing with per category is pretty low though, n=50
Quote Reply
Re: [scorpioncapital] random generator In reply to
Ah, through a global I'm guessing?

If the query looks something like;

select_options('ORDER BY RAND()');

....then it should be the MySQL random, which is pretty good (IMO) at getting random numbers. You can go a bit more advanced, and use some perl code to come up with a random row, depending on the number of entries. I believe Jump.pm has this in it.

Hope that helps.

Cheers

Andy (mod)
andy@ultranerds.co.uk
Want to give me something back for my help? Please see my Amazon Wish List
GLinks ULTRA Package | GLinks ULTRA Package PRO
Links SQL Plugins | Website Design and SEO | UltraNerds | ULTRAGLobals Plugin | Pre-Made Template Sets | FREE GLinks Plugins!