Judah McAuley wrote:
> Barney's solution is good but doesn't change the fact that you are
> authenticating based on a piece of information that someone else can
> grab (a cookie). I understand that one of your requirements is that
> people not have to use a username and password to log in every tim
> When you say "You know the secret key", are you referring to the site or
> the user?
Sorry, I wasn't very clear. The site knows the key, so only the site
can validate the contents of cookies.
> Either way, how would this stop someone from copying the key and using
> it on another computer?
Ye
Well, I set the cookie every page load, but you are saying..
If the cookie doesn't match up with what the last "Counter" I used (I.e.
if the cookie shows a counterID of 5 and it should be a 6), then
redirect to the login. Right?
If that's correct, once they stop using the page, what's to preven
I would add the following:
Barney's solution is good but doesn't change the fact that you are
authenticating based on a piece of information that someone else can
grab (a cookie). I understand that one of your requirements is that
people not have to use a username and password to log in every time
The simplest mechanism is to only allow a cookie to be used once, and
then reset it each request. You get the cookie, ensure it's valid,
ensure the id hasn't been used before, create a new cookie, set it,
and then process the request. If the cookie isn't valid or the id has
been used, you clear t
When you say "You know the secret key", are you referring to the site or
the user?
Either way, how would this stop someone from copying the key and using
it on another computer?
Let's say the phrase "SecretKey" was the secret key.. So my cookie would
look like this..
PVector:1/1/2010:7f98w7f9
create your cookie like this:
#userId#:#expirationDate#:#hash(userId & expirationDate & yourSecretKey)#
Then you can ensure the cookie came from you and that it hasn't been
manipulated, because only you can properly create the hash (because
only you know the secret key).
cheers,
barneyb
On Tue,
So how do you suggest I validate the cookie without requiring User input
(invalidating the purpose of the cookie in the first place)?
Barney Boisvert wrote:
> A spin attack is when you manipulate some form of captured user input.
> It's usually a number, so the name comes from spinning a numeric
A spin attack is when you manipulate some form of captured user input.
It's usually a number, so the name comes from spinning a numeric
dial. Any user input, which includes cookies, has to be validated.
If you just trust the cookie, anyone who steals the cookie can
impersonate the user. Even enc
If you managed to copy a cookie to your machine, then either 1 of 2
things happened.
1) I gave you permission to do so and therefore, I understand the
concept that I'm giving you my ID on the site basically.
2) You took it without me knowing. This would involve you accessing my
computer in some
What if I copied your cookie to my machine? I go to your site, it
checks to see if I have a cookie, I do, so it grabs the encrypted UUID
value in that cookie, checks it against your db, matches your record,
then logs me in as you.
I don't have to know the value of the UUID. It doesn't matter that
Perhaps you weren't reading it clearly. Allow me to explain.
I give the UserID (in UUID form and encrypted) out when someone hits my
site.
When a user has it, I load up that profile and they "log in" to the site.
If a user doesn't have it, they need to log in with a username and password.
I fa
-Original Message-
From: Judah McAuley <[EMAIL PROTECTED]>
Sent: Tuesday, October 28, 2008 2:45 PM
To: cf-talk
Subject: Re: Random record identifiers in MySQL 5.0
~|
Adobe® ColdFusion® 8 software 8 is the most imp
On Tue, Oct 28, 2008 at 12:37 PM, Jason Fisher <[EMAIL PROTECTED]> wrote:
> @Jim,
>
> If you use CF to generate a UUID, then you do *not* need to hit the DB to
> verify uniqueness. Each call to createUUID() will create a unique value,
> within all limits of reasonableness. So, yes, autoIncremen
Yeah, I don't think that logically follows at all. An id is not a
credential, it shouldn't matter if the id is easy to guess or not. The
id is the representation of the item in question. Knowing what/who the
item is shouldn't allow you to become that item.
I have no problems with using uuid's as p
WHAT You store a userId in a cookie and trust it Are you
mad??? Numbers are as inherently secure as UUIDs - they're both
simply identifiers. Authentication and authorization are where
security happens. If an application is susceptible to spin attacks
like that, I suppose that a UUID mi
@Jim,
If you use CF to generate a UUID, then you do *not* need to hit the DB to
verify uniqueness. Each call to createUUID() will create a unique value,
within all limits of reasonableness. So, yes, autoIncrement works as well, but
to answer your original question, createUUID() is a clean way
> *nods* I do. But the extra layer of UUID is better then using auto increase.
Personally I strongly disagree with that but hey ho, each to their own
~|
Adobe® ColdFusion® 8 software 8 is the most important and dramatic release
*nods* I do. But the extra layer of UUID is better then using auto increase.
Barney Boisvert wrote:
> And you can guess my login for Gmail from my email address. But in
> order to access it, you have to know my credentials. Hopefully you do
> similar checks in your applications?
>
> On Tue, Oct
Oh.. I have that as well. But take for example the UserID that I store
as a cookie to someone else based on the UserID field.
It's easy to change a cookie to a 1 and hope to get admin access.
It's harder to figure out someone elses ID. :)
and yeah, I can set it to the IP and so on, but honestly
And you can guess my login for Gmail from my email address. But in
order to access it, you have to know my credentials. Hopefully you do
similar checks in your applications?
On Tue, Oct 28, 2008 at 12:13 PM, Phillip M. Vector
<[EMAIL PROTECTED]> wrote:
> The only thing I've noticed in using that
On Tue, Oct 28, 2008 at 2:13 PM, Phillip M. Vector wrote:
> The only thing I've noticed in using that is that you can guess the next
> number.
>
> If you have a URL string of id set to 7, I've always tried manually
> typing in 6 and seeing what happens. Sometimes, 5. :)
>
>
That's what permission
The only thing I've noticed in using that is that you can guess the next
number.
If you have a URL string of id set to 7, I've always tried manually
typing in 6 and seeing what happens. Sometimes, 5. :)
Now, can you guess another record if the ID is 3219-D87562EFA- etc.? :)
Barney Boisvert wro
Can't you just use an AUTO_INCREMENT column? That's what they're there for.
On Tue, Oct 28, 2008 at 11:40 AM, Jim McAtee <[EMAIL PROTECTED]> wrote:
> What are you using for random (unique) record identifiers in MySQL? I
> could use UUIDs, generated either in my CF application, or in MySQL
> itse
What are you using for random (unique) record identifiers in MySQL? I
could use UUIDs, generated either in my CF application, or in MySQL
itself. But for a table that's never likely to have more than a few
hundred thousand records I could also just use something like a 10
character randomly g
Thank you Dean for seeing my issue, and supplying a possible resolution. I
agree access is not the best system out there, But I have applications with
over 500,000 records in a single table that have been working with cold fusion
of many years also. I agree I should migrate but that is not in my
> > ORDER BY Rnd(fld_page_ID)
>
> This command keeps pulling the same order, even if I close the browser.
> If they go back to the main page I would like possibility of having a
> different news item appear.
Keith,
This is a ColdFusion caching issue. If you run the query directly in Access,
I understand you want to stay with access for whatever reason. But
consider how much trouble this is for you.. Are you sure you aren't able
to use a different database (or convince your client that he should move
up)? I mean, access can only handle 1 user at a time anyway.. That alone
should be
> ORDER BY Rnd(fld_page_ID)
This command keeps pulling the same order, even if I close the browser. If they
go back to the main page I would like possibility of having a different news
item appear.
~|
Adobe® ColdFusion® 8 soft
Keith,
You can pull a random record from Access by using the Rnd() function. So your
query would look like this:
select fld_page_ID, fld_title, fld_body, fld_attach_ID, fld_url,
fld_active_date, fld_inactive_date
from tbl_marketing_pages
where fld_item_type = "n"
Thanks for the suggestion, but I tried that and I didn't work.
~|
Adobe® ColdFusion® 8 software 8 is the most important and dramatic release to
date
Get the Free Trial
http://ad.doubleclick.net/clk;207172674;29440083;f
Archive:
Well, Access isn't a database.
If you gave several sites, why not just make them in oracle?
I mean, why use access at all?
Keith McGee wrote:
>> *snip*
>>
>> 1. Use MySQL.
>> 2. Order by Rand()
>> 3. ???
>> 4. Profit
>
> this is not the only program or site running off of access database, w
, Keith McGee wrote:
> I created a random record generator for pulling current news items.
> I am using an access database for the back end and would like to
> know if anyone has a better solution. This code works, but I think
> I'm missing something. Thank you in advance
>*snip*
>
>1. Use MySQL.
>2. Order by Rand()
>3. ???
>4. Profit
this is not the only program or site running off of access database, we do have
oracle and I know I could use where rownum = #randomID#, but I am looking for
an access solution.
~~~
Keith McGee wrote:
> I am using an access database for the back end
> and would like to know if anyone has a better solution.
*snip*
1. Use MySQL.
2. Order by Rand()
3. ???
4. Profit
~|
Adobe® ColdFusion® 8 software 8 is th
I created a random record generator for pulling current news items. I am using
an access database for the back end and would like to know if anyone has a
better solution. This code works, but I think I'm missing something. Thank you
in advance Keith.
Step 1: Pull the current records and
Thanks guys!
These ideas did the trick! :)
Will
~|
Message: http://www.houseoffusion.com/lists.cfm/link=i:4:236502
Archives: http://www.houseoffusion.com/cf_lists/threads.cfm/4
Subscription: http://www.houseoffusion.com/lists.c
You could alwys just say F it and manually pick a record.
=]
Oh yeah, where do I sign up and what do I win?
--
Alan Rother
Macromedia Certified Advanced ColdFusion MX 7 Developer
~|
Message: http://www.houseoffusion.com/list
://support.microsoft.com/?kbid=210468
..:.:.:.:.:.:.:.:.:.:.:.:.
Bobby Hartsfield
http://acoderslife.com
-Original Message-
From: Andy Matthews [mailto:[EMAIL PROTECTED]
Sent: Wednesday, March 29, 2006 4:18 PM
To: CF-Talk
Subject: RE: Pulling a random record from the DB
You didn
: CF-Talk
Subject: Re: Pulling a random record from the DB
I should mention that the latter option - returning everything just to
use one - can have a big performance impact, so be careful with that
one.
On 3/29/06, Rob Wilkerson <[EMAIL PROTECTED]> wrote:
> Not so easy, then. Try Googl
You didn't specfically say your db so here's how to do it in mySQL.
SELECT id
FROM customers
ORDER BY RAND()
LIMIT 1
That will give you one random record.
-Original Message-
From: Will Tomlinson [mailto:[EMAIL PROTECTED]
Sent: Wednesday, March 29, 2006 1:54 PM
To: CF-Ta
I should mention that the latter option - returning everything just to
use one - can have a big performance impact, so be careful with that
one.
On 3/29/06, Rob Wilkerson <[EMAIL PROTECTED]> wrote:
> Not so easy, then. Try Google-ing "ms access random record" and
> you'
Not so easy, then. Try Google-ing "ms access random record" and
you'll get a lot of info about creating seeds, etc. You can go that
direction or return all and select a random record using randRange (
1, queryName.recordcount ).
Again, that's from memory, so you might have t
What DB are you using?
If you are using MS SQL Server you can create a new column in your query and
give it the value of a random number and then sort by that column, then just
take the top record as the winner.
SELECT NEWID() AS Test
FROM MyTable
ORDER BY Test
Just Query Your DB as
> What DB? With SQL Server 2K, I think the following will work
> (untested - going straight from distant memory):
I'm sorry - it's Access.
Thanks,
Will
~|
Message: http://www.houseoffusion.com/lists.cfm/link=i:4:236460
Archive
What DB? With SQL Server 2K, I think the following will work
(untested - going straight from distant memory):
SELECT TOP 1 myfield
FROM mytable
ORDER BY NEWID()
On 3/29/06, Will Tomlinson <[EMAIL PROTECTED]> wrote:
> I need to pull a random record from an autonumber field. It's f
I need to pull a random record from an autonumber field. It's for a prize for
the lucky winner. :)
I'd thought about creating a ValueList() from the ID field, but then got stuck
in my thinking. What's the best way to accomplish this
> Is there a MySQL equivalent to this newID() functionality?
With MySQL you can pull out one random row by using a combination of
ORDER BY RAND() and LIMIT, e.g.:
SELECT * FROM myTable ORDER BY RAND() LIMIT 1
Tim.
--
---
Badpen Tech - CF and w
Is there a MySQL equivalent to this newID() functionality?
--
Jay
> -Original Message-
> From: Charlie Griefer [mailto:[EMAIL PROTECTED]
> Sent: 20 July 2004 22:42
> To: CF-Talk
> Subject: Re: Retrieve a random record from a database
>
> as a rule, you should
From: "Dustin Snell [Network Automation, Inc]"
> <[EMAIL PROTECTED]>
> To: "CF-Talk" <[EMAIL PROTECTED]>
> Sent: Tuesday, July 20, 2004 2:21 PM
> Subject: Retrieve a random record from a database
>
> > We have a database with a bunch of customer testim
r specific...so your app's "portability"
suffers a bit)
- Original Message -
From: "Jeff Langevin" <[EMAIL PROTECTED]>
To: "CF-Talk" <[EMAIL PROTECTED]>
Sent: Tuesday, July 20, 2004 2:34 PM
Subject: Re: Retrieve a random record from a d
You could do something like
SELECT TOP 1 *
FROM Testiments
WHERE Public = 1
ORDER BY NewID()
HTH
- Original Message -
From: Dustin Snell [Network Automation, Inc]
<[EMAIL PROTECTED]>
Date: Tue, 20 Jul 2004 14:21:44 -0700
Subject: Retrieve a random record from a database
To: C
SELECT TOP 1
field1,
field2,
...
FROM
table
WHERE
public = 1
ORDER BY
newID()
- Original Message -
From: "Dustin Snell [Network Automation, Inc]"
<[EMAIL PROTECTED]>
To: "CF-Talk" <[EMAIL PROTECTED]>
Sent: Tuesday, July 20, 2004 2:
You could query for all public records and then use
randRange(1,myquery.recordcount). That'll give you a random row. Then
use the primary key to do whatever you need form there. HTH.
--Jeff
Dustin Snell [Network Automation, Inc] wrote:
> We have a database with a bunch of customer testimoni
We have a database with a bunch of customer testimonials in it. Records can
be added to it at anytime. Some are marked public and some or not. Does
anyone know how I could pull a single record randomly from the database
using MSSQL2000 and CF6.1 for display on the website - but only out of the
reco
One way:
HTH
J
- Original Message -
From: "Eric J Hoffman" <[EMAIL PROTECTED]>
To: "CF-Talk" <[EMAIL PROTECTED]>
Sent: Monday, April 08, 2002 5:19 PM
Subject: Random Record
> What is the best way to get a random record from an table that has
&g
At 11:29 PM 4/8/02 +0200, you wrote:
>Eric J Hoffman wrote:
> > What is the best way to get a random record from an table that has
> > frequent changes and updates...best practices or practical advice from
> > veterans? Randrange between 1 and recordcount won't work
Street #201
Ph: 703-823-4300 x119 Alexandria, VA 22304
fax: 703-823-4301 http://www.csmi.com
> -Original Message-
> From: Jochem van Dieten [mailto:[EMAIL PROTECTED]]
> Sent: Monday, April 08, 2002 5:30 PM
> To: CF-Talk
> Subject: Re: Random Record
>
>
&
Eric J Hoffman wrote:
> What is the best way to get a random record from an table that has
> frequent changes and updates...best practices or practical advice from
> veterans? Randrange between 1 and recordcount won't work pulling a num
> and then going against primary id..so
What is the best way to get a random record from an table that has
frequent changes and updates...best practices or practical advice from
veterans? Randrange between 1 and recordcount won't work pulling a num
and then going against primary id..so somehow to get a "row"?
Thanks.
.
An array would probably be easier for that though.
__
steve oliver
atnet solutions, inc.
http://www.atnetsolutions.com
-Original Message-
From: Jeff Fongemie [mailto:[EMAIL PROTECTED]]
Sent: Thursday, January 31, 2002 3:40 PM
To: CF-Talk
Subject: Get a random
I forgot to mention that you'll want to use an application var to store that
ID so that it persists for you.
~Val
- Original Message -
From: "Jeff Fongemie" <[EMAIL PROTECTED]>
To: "CF-Talk" <[EMAIL PROTECTED]>
Sent: Thursday, January 31, 2002 3:40
question?
HTH!
~Val
- Original Message -
From: "Jeff Fongemie" <[EMAIL PROTECTED]>
To: "CF-Talk" <[EMAIL PROTECTED]>
Sent: Thursday, January 31, 2002 3:40 PM
Subject: Get a random record, but not too random?
> Thursday, January 31, 2002, 3:32:59 PM
>
Thursday, January 31, 2002, 3:32:59 PM
Hello cf-talk,
I've got a layout that displays a random set of images on each page.
I have one to many DB setup, with image sets, and images
respectively. I first find a random set, then get the images for
that set. It works like this:
SELECT
> Someone posted this idea a while back.
>
> SELECT TOP 1 employee_id, newid() as new_id
> FROM yourtable
>
> CC
That pulls the first1 record from the database. This will pull the first
1000 records...
SELECT TOP 1000 employee_id, newid() as new_id
FROM yourtable
I need a ra
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1
You'll actually need to add an order by new_id clause at the end of that
statement to consistently return a random record (otherwise you just get the
first record in the table).
SELECT TOP 1 employee_id, newid() as new_id
FROM yourtable
ORD
How do I select a single, truly random (random seed) record from my
database?
Thanks,
Steve
~~
Structure your ColdFusion code with Fusebox. Get the official book at
http://www.fusionauthority.com/bkinfo.cfm
FAQ: http://www.thenetprofits.co.uk/co
PROTECTED]]
Sent: Wednesday, January 17, 2001 5:50 PM
To: CF-Talk
Subject: RE: random record
Hi Mark, howzit going? ;-)
Actually, I think your method (choosing a random number between 1 and MaxID,
then going for the first record >= MaxID) could lead to some very
non-random behaviour when you h
Hi Mark, howzit going? ;-)
Actually, I think your method (choosing a random number between 1 and MaxID,
then going for the first record >= MaxID) could lead to some very
non-random behaviour when you have large gaps in your IDs. The first ID
after a large gap will be heavily over-used.
I still
emy Bunton [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, January 17, 2001 2:46 PM
To: CF-Talk
Subject: RE: random record
Thanks Mark that seems to have done the trick.
JLB
-Original Message-
From: Warrick, Mark [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, January 16, 2001 6:36 PM
To: CF-Talk
Thanks Mark that seems to have done the trick.
JLB
-Original Message-
From: Warrick, Mark [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, January 16, 2001 6:36 PM
To: CF-Talk
Subject: RE: random record
There are many ways to do this. Here's one:
SELECT max (CONTACT_ID) as maxid
nal Message-
> From: Jeremy Bunton [mailto:[EMAIL PROTECTED]]
> Sent: Tuesday, January 16, 2001 1:32 PM
> To: CF-Talk
> Subject: random record
>
>
> Can anyone point me in the right direction regarding how I would go about
> pulling a random record from a table every ti
At 04:31 PM 1/16/01 -0500, you wrote:
>Can anyone point me in the right direction regarding how I would go about
>pulling a random record from a table every time a user visits the page.
query the table as normal
use RandRange(1,#query.RecordCount#) to select a random number
Output onl
nuary 16, 2001 4:32 PM
> To: CF-Talk
> Subject: random record
>
>
> Can anyone point me in the right direction regarding how I would go about
> pulling a random record from a table every time a user visits the page.
>
> JLB
>
>
>
>
~~~
[mailto:[EMAIL PROTECTED]]
Can anyone point me in the right direction regarding how I would go about
pulling a random record from a table every time a user visits the page.
IMPORTANT NOTICE:
This e-mail and any attachment to it is intended only to be read or used by
the named addressee. It is
Here a couple scripts.
Pull a random record.
http://cfhub.com/discussion/viewmessages.cfm?Forum=5&Topic=170
Pull a list of random records:
http://cfhub.com/discussion/viewmessages.cfm?Forum=8&Topic=178
> Can anyone point me in the right direction regarding how I would go about
Can anyone point me in the right direction regarding how I would go about
pulling a random record from a table every time a user visits the page.
JLB
~~
Structure your ColdFusion code with Fusebox. Get the official book at
http
00 PM
> To: CF-Talk
> Subject: RE: Random Record
>
>
> x = total available records
>
>
> SELECT * FROM TABLE WHERE ID = Random Count
>
>
>
> -Original Message-
> From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]
> Sent: Thursday, Oc
CQ: 346566
--
> -Original Message-
> From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]
> Sent: Thursday, October 05, 2000 4:49 PM
> To: CF-Talk
> Subject: Random Record
>
>
> How could i select a random record from a tab
yep...
You're rigth pan.
I will change my programs...
thanks!
~Juandres
- Original Message -
From: pan <[EMAIL PROTECTED]>
To: CF-Talk <[EMAIL PROTECTED]>
Sent: Friday, October 06, 2000 2:04 PM
Subject: Re: Random Record
> From: "Juan Andres Alvarez Vale
If that's the case just do this:
SELECT *
FROM QUOTES
Random Record No = #selectrandomrecord.ID#
Quote = #selectrandomrecord.Quote#
Author = #selectrandomrecord.A
: Thursday, October 05, 2000 6:49 PM
To: CF-Talk
Subject: Random Record
How could i select a random record from a table?
Like to set my query as
SELECT *
FROM Table
WHERE RecordID = ??
Anyone know how to do this?
thanks
kev
From: "Juan Andres Alvarez Valenzuela" <[EMAIL PROTECTED]>
> I use the database for that (better? I think ):
>
> SELECT count(*) total,
> (ceiling((RAND( (DATEPART(ms, GETDATE()) * 10 )+ (DATEPART(ss,
> GETDATE()) * 1000 )+ DATEPART(mm, GETDATE()) ))*count(*))) rand
> FROM YourTable
>
-
1100120.0
record selected: 120
~Juandres
- Original Message -
From: Lee Borkman <[EMAIL PROTECTED]>
To: CF-Talk <[EMAIL PROTECTED]>
Sent: Friday, October 06, 2000 7:24 PM
Subject: RE: Random Record
Guys,
this will only work if the IDs start at 1, and there ar
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]
>
> well what i want to be able to do is like show a random quote from a table
> of quotes
>
> Now some may be deleted, some may be added, in which the
>
>
>
> would not work because the "ID" numbers in the table would be changing, is
>
Kev,
Don't look right past my previous answer. It works like a charm. It doesn't
care what your IDs are called, or how they are sequenced. For best results,
cache the query.
As I said before, there's no way to do this is SQL alone.
So do this:
SELECT * FROM quotes
#QuoteT
get id from table
Show Quote
Try again
-Original Message-
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]
Sent: Thursday, October 05, 2000 8:52 PM
To: CF-Talk
Subject: Re: Random Record
well what i want to be able to do is like show a random quote from a table
of quotes
well what i want to be able to do is like show a random quote from a table of
quotes
Now some may be deleted, some may be added, in which the
would not work because the "ID" numbers in the table would be changing, is there a way
to specify like a certain Row number in my SQL WHERE state
h would be infinitely faster if you're dealing with large text fields or
something.
Have fun! ;-)
- Original Message -
From: "Jason Stiefel" <[EMAIL PROTECTED]>
To: "CF-Talk" <[EMAIL PROTECTED]>
Sent: Thursday, October 05, 2000 10:13 PM
Subject: Re: Rando
TABLE WHERE ID = Random Count
-Original Message-
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]
Sent: Thursday, October 05, 2000 4:49 PM
To: CF-Talk
Subject: Random Record
How could i select a random record from a table?
Like to set my query as
SELECT *
FROM Table
WHERE RecordID
kev-
selectmyfields
frommytable
#myQuery[intRecord].field#
You can treat any query as if it were an array.
- Original Message -
From: <[EMAIL PROTECTED]>
To: "CF-Talk" <[EMAIL PROTECTED]>
Sent: Thursday, October 05, 2000 7:49 PM
Subject:
x = total available records
SELECT * FROM TABLE WHERE ID = Random Count
-Original Message-
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]
Sent: Thursday, October 05, 2000 4:49 PM
To: CF-Talk
Subject: Random Record
How could i select a random record from a table?
Like to set my
] wrote:
How could i select a random record from a table?
Like to set my query as
SELECT *
FROM Table
WHERE RecordID = ??
Anyone know how to do this?
thanks
kev
--
Archives: http://www.mail-archive.com/cf-talk
How could i select a random record from a table?
Like to set my query as
SELECT *
FROM Table
WHERE RecordID = ??
Anyone know how to do this?
thanks
kev
--
Archives: http://www.mail-archive.com/cf-talk
> I have a database of 4,000 or so records. I would like to do a query based
> on some conditions (i.e. where active =1 AND group_id = 45). I
> can do this.
> The problem I have having is that out of the conditional query I
> would like
> to pull a random 3 records out and have use and be able to
Hi.
I have a database of 4,000 or so records. I would like to do a query based
on some conditions (i.e. where active =1 AND group_id = 45). I can do this.
The problem I have having is that out of the conditional query I would like
to pull a random 3 records out and have use and be able to output
ave to worry if the number exists of not . :)
[]'s
Vinicius
-Mensagem original-
De: Gary McNeel, Jr. <[EMAIL PROTECTED]>
Para: Cf-Talk <[EMAIL PROTECTED]>
Data: Quinta-feira, 15 de Junho de 2000 18:35
Assunto: Easy way to get a random record
>Is there an easy way to p
AIL PROTECTED]]
Subject: Easy way to get a random record
Is there an easy way to pick a random record from a database. I have a
unique ID for each record, but it is not strictly sequential because of
record deletions.
Here is my thought:
Run a query and get the MAX and MIN IDs.
Do a loop usin
Gary: I'm sending this to you via email since CF-Talk has been so screwed up
recently.
> Thank you Phoebe, but most of the replies I have gotten do not take into
> account the deletion of a record, and hence, the broken line of sequential
> IDs.
Here's the way I would do this. I followed your a
MemberName
1 Name1
2 Name2
3 Name3
4 Name4
Getting the random record here is easy. Run the query and get the record
count, then do a randrange(1, recordcount), then use that to retrieve a
record. So the recordcount is 4, randrange(1,4), random number generated is,
say 3, now
1 - 100 of 105 matches
Mail list logo