Re: [PHP-DB] Random pick

2010-01-25 Thread Karl DeSaulniers
Hello List, Trying to learn the right way to code this line. Can anyone tell me if I am doing this the right way? if $req_user_level == 0 || 1 || 2 || 3 || 4 || 5 || 6 || 7 || 8 || 9 ? Guest || Regular User || Intl. User || Contractor || Employee || Sales || Investor || Human Resources ||

Re: [PHP-DB] Random pick

2010-01-25 Thread Olavi Ivask
Hi, did you mean something like this? $level_names = array(Guest, Regular User, Intl. User, Contractor, Employee, Sales, Investor, Human Resources, Administrator); $user_level = $level_names[$req_user_level]; Regards, Olavi Ivask On Jan 25, 2010, at 9:13 PM, Karl

Re: [PHP-DB] Random pick

2010-01-25 Thread Peter Beckman
On Mon, 25 Jan 2010, Karl DeSaulniers wrote: Hello List, Trying to learn the right way to code this line. Can anyone tell me if I am doing this the right way? if $req_user_level == 0 || 1 || 2 || 3 || 4 || 5 || 6 || 7 || 8 || 9 ? Guest || Regular User || Intl. User || Contractor || Employee

Re: [PHP-DB] Random pick

2010-01-25 Thread Karl DeSaulniers
Hi, $req_user_level is a MySql return result and I am trying to utilize shortened code to evaluate whither $req_user_level == 0 || 1 || 2 || 3 || 4 || 5 || 6 || 7 || 8 || 9, if it matches a number, return the text associated with that number. Guest || Regular User || Intl. User ||

Re: [PHP-DB] Random pick

2010-01-25 Thread Karl DeSaulniers
I am trying to avoid doing this: if ($req_user_level == 0) { $req_user_level = Guest; } else if ($req_user_level == 1) { req_user_level = Regular User } etc.. Karl DeSaulniers Design Drumm http://designdrumm.com

Re: [PHP-DB] Random pick

2010-01-25 Thread Olavi Ivask
Don't you like my solution? Regards, Olavi On Jan 25, 2010, at 9:39 PM, Karl DeSaulniers wrote: Hi, $req_user_level is a MySql return result and I am trying to utilize shortened code to evaluate whither $req_user_level == 0 || 1 || 2 || 3 || 4 || 5 || 6 || 7 || 8 || 9, if it matches a

Re: [PHP-DB] Random pick

2010-01-25 Thread Karl DeSaulniers
Thank you for this as well. Question? What part is in_array playing? Is it comparing $req_user_level to array()? Because the text Guest, etc.. is not in $req_user_level on the database. In other words, is it checking the value of $req_user_level to see if Guest is in it? Karl On Jan 25,

Re: [PHP-DB] Random pick

2010-01-25 Thread Peter Beckman
On Mon, 25 Jan 2010, Karl DeSaulniers wrote: Thank you for this as well. Question? What part is in_array playing? Is it comparing $req_user_level to array()? Because the text Guest, etc.. is not in $req_user_level on the database. In other words, is it checking the value of $req_user_level to

Re: [PHP-DB] Random pick

2010-01-25 Thread Karl DeSaulniers
Yes, $req_user_level is an int between 0 and 9. Yes, the other code worked great. Thank you for your response though. That is definitely a good way to cross check. Thanks again for your responses. Best, Karl On Jan 25, 2010, at 2:24 PM, Peter Beckman wrote: On Mon, 25 Jan 2010, Karl

Re: [PHP-DB] Random pick

2009-12-21 Thread David McGlone
On Saturday 19 December 2009 03:54:34 Karl DeSaulniers wrote: Dont know if you found anything, but I ran accross this in on of my other searches. http://php.about.com/od/finishedphp1/p/day_redirect.htm Karl On Dec 18, 2009, at 10:10 AM, Philip Thompson wrote: On Dec 15, 2009, at 6:02

Re: [PHP-DB] Random pick

2009-12-19 Thread Karl DeSaulniers
Dont know if you found anything, but I ran accross this in on of my other searches. http://php.about.com/od/finishedphp1/p/day_redirect.htm Karl On Dec 18, 2009, at 10:10 AM, Philip Thompson wrote: On Dec 15, 2009, at 6:02 PM, David McGlone wrote: On Monday 14 December 2009 21:44:24

Re: [PHP-DB] Random pick

2009-12-18 Thread Philip Thompson
On Dec 15, 2009, at 6:02 PM, David McGlone wrote: On Monday 14 December 2009 21:44:24 Chris wrote: Chris wrote: David McGlone wrote: On Monday 14 December 2009 21:02:37 Chris wrote: David McGlone wrote: Hi everyone, I've been lurking in the shadows on the list for quite some time and

Re: [PHP-DB] Random pick

2009-12-15 Thread David McGlone
On Monday 14 December 2009 21:44:24 Chris wrote: Chris wrote: David McGlone wrote: On Monday 14 December 2009 21:02:37 Chris wrote: David McGlone wrote: Hi everyone, I've been lurking in the shadows on the list for quite some time and now I'm in need of a little info or advise.

[PHP-DB] Random pick

2009-12-14 Thread David McGlone
Hi everyone, I've been lurking in the shadows on the list for quite some time and now I'm in need of a little info or advise. I'm looking for a way to grab a record out of a database on a certain day each month and I'm wondering if this can be accomplished with just a mysql query or would I

Re: [PHP-DB] Random pick

2009-12-14 Thread Chris
David McGlone wrote: Hi everyone, I've been lurking in the shadows on the list for quite some time and now I'm in need of a little info or advise. I'm looking for a way to grab a record out of a database on a certain day each month and I'm wondering if this can be accomplished with just a

Re: [PHP-DB] Random pick

2009-12-14 Thread David McGlone
On Monday 14 December 2009 21:02:37 Chris wrote: David McGlone wrote: Hi everyone, I've been lurking in the shadows on the list for quite some time and now I'm in need of a little info or advise. I'm looking for a way to grab a record out of a database on a certain day each month

Re: [PHP-DB] Random pick

2009-12-14 Thread Chris
David McGlone wrote: On Monday 14 December 2009 21:02:37 Chris wrote: David McGlone wrote: Hi everyone, I've been lurking in the shadows on the list for quite some time and now I'm in need of a little info or advise. I'm looking for a way to grab a record out of a database on a certain day

Re: [PHP-DB] Random pick

2009-12-14 Thread Chris
Chris wrote: David McGlone wrote: On Monday 14 December 2009 21:02:37 Chris wrote: David McGlone wrote: Hi everyone, I've been lurking in the shadows on the list for quite some time and now I'm in need of a little info or advise. I'm looking for a way to grab a record out of a database on

[PHP-DB] Random content from MySql DB

2008-08-26 Thread A. Joseph
I`m creating a small application that let users take test online, the user will login and visit the test page, questions and answers are stored in MySql database, i want to display each randomly without repeating. test must to completed between some specific amount of time or else the

RE: [PHP-DB] Random content from MySql DB

2008-08-26 Thread Simcha
If the past questions are 1,2,3,4: Select * from `questions` where id not in (1,2,3,4) order by RAND(); Simcha Younger -Original Message- From: A. Joseph [mailto:[EMAIL PROTECTED] Sent: Tuesday, August 26, 2008 7:38 PM To: php-db@lists.php.net Subject: [PHP-DB] Random content from

Re: [PHP-DB] random 'card number' generator

2006-11-24 Thread Jeffrey
D. Go to the manual at http://be2.php.net/manual/en/function.rand.php and look at the User contributed notes further down the page. You'll find a couple of solutions. Whatever you do, you will presumably need to check the generated number against the db to see if it is already in use and,

[PHP-DB] Random Password problem

2005-03-08 Thread J. Connolly
I am using this php in order to create, store and send random passwords to people who want to join my mailing list. ?php function random_password () { $seed = (integer) md5(microtime()); mt_srand($seed); $password = mt_rand(1,); $password = substr(md5($password), 3,9); return $password;

Re: [PHP-DB] Random Password problem

2005-03-08 Thread Stephen Johnson
PROTECTED] 562.924.4454 (office) 562.924.4075 (fax) continuing the struggle against bad code */ ? From: J. Connolly [EMAIL PROTECTED] Date: Tue, 08 Mar 2005 14:41:11 -0500 To: PHP list php-db@lists.php.net Subject: [PHP-DB] Random Password problem I am using this php in order to create

RE: [PHP-DB] Random Password problem

2005-03-08 Thread Wendell Frohwein
.= $allowable_characters[mt_rand(0,$ps_len-1)]; } return $pass; } Its been working well for me for sometime. -Wendell Frohwein -Original Message- From: J. Connolly [mailto:[EMAIL PROTECTED] Sent: Tuesday, March 08, 2005 11:41 AM To: PHP list Subject: [PHP-DB] Random Password problem I am using this php

RE: [PHP-DB] Random Password problem

2005-03-08 Thread Bastien Koert
Frohwein [EMAIL PROTECTED] To: 'J. Connolly' [EMAIL PROTECTED],'PHP list' php-db@lists.php.net Subject: RE: [PHP-DB] Random Password problem Date: Tue, 8 Mar 2005 11:51:59 -0800 This is one I like to use jozef. function generate_password($length = 10) { $allowable_characters

Re: [PHP-DB] Random Password problem

2005-03-08 Thread Jochem Maas
J. Connolly wrote: I am using this php in order to create, store and send random passwords to people who want to join my mailing list. ?php function random_password () { $seed = (integer) md5(microtime()); mt_srand($seed); your seeding the randomizer with the value zero each time! the

[PHP-DB] Random Character String

2005-03-05 Thread Ron Piggott
Is there a way of generating an 8 character random string in PHP? Is there a way to ignore UPPER and lower case when you are using the SELECT command to find a record in the mySQL table? I know this isn't an HTML forum ... I have one more question which is more HTML in nature. I don't want some

Re: [PHP-DB] Random Character String

2005-03-05 Thread Ron Piggott
The robots that index the web. Bastien gave me a web site to use for this. Thanks. Ron - Original Message - From: Zareef Ahmed [EMAIL PROTECTED] To: Ron Piggott [EMAIL PROTECTED] Cc: PHP DB php-db@lists.php.net Sent: Saturday, March 05, 2005 11:56 AM Subject: Re: [PHP-DB] Random

RE: [PHP-DB] Random Character String

2005-03-05 Thread Bastien Koert
PROTECTED] To: PHP DB php-db@lists.php.net Subject: [PHP-DB] Random Character String Date: Sat, 5 Mar 2005 09:38:35 -0500 Is there a way of generating an 8 character random string in PHP? Is there a way to ignore UPPER and lower case when you are using the SELECT command to find a record in the mySQL

Re: [PHP-DB] Random Number generating and adding it to he database..

2005-01-23 Thread Samar
On Sun, 23 Jan 2005 10:43:03 +0400, Radwan Aladdin [EMAIL PROTECTED] wrote: I wanted to know the best Random Function for PHP.. But please I don't want duplications to happen at the same second.. because I receive many customers.. For that purpose, mt_rand ( [int min, int max]) function is

[PHP-DB] Random Number generating and adding it to he database..

2005-01-22 Thread Radwan Aladdin
Hi all! I wanted to know the best Random Function for PHP.. But please I don't want duplications to happen at the same second.. because I receive many customers.. And also how can I add [EMAIL PROTECTED], whic abc is a variable... and localhost.com is a static text?? So I only request from the

Re: [PHP-DB] Random select -- Where am I going wrong?

2004-07-05 Thread Alvaro Zuniga
See Below On Sun, 2004-07-04 at 05:54, Ronald The Newbie Allen wrote: Here is my code I keep on getting a Resource id #2 ..whatever that meansany help would be appreciated! html head titleTop Frame/title /head body bgcolor=#ff text=#00 link=#ff

[PHP-DB] Random select -- Where am I going wrong?

2004-07-04 Thread Ronald \The Newbie\ Allen
Here is my code I keep on getting a Resource id #2 ..whatever that meansany help would be appreciated! html head titleTop Frame/title /head body bgcolor=#ff text=#00 link=#ff vlink=#800080 alink=#ff EMBED SRC= autostart=true hidden=true loop=true volume=100% ?

Re: [PHP-DB] Random select -- Where am I going wrong?

2004-07-04 Thread Larry E . Ullman
Here is my code I keep on getting a Resource id #2 ..whatever that meansany help would be appreciated! $music = mysql_query (Select * from $db_table ORDER BY RAND() Limit 1); if(!$music) die(Query Failed.); while($row = mysql_fetch_row($music)) print $music; } This is because

Re: [PHP-DB] Random not working?

2003-03-01 Thread Doug Thompson
This recent thread from the mysql list explains a lot about the problem. http://lists.mysql.com/cgi-ez/ezmlm-cgi?1:mss:15034 hth, Doug On Sat, 1 Mar 2003 12:24:57 +0100, Frank Keessen wrote: Hi All, I'm trying to get a random record each time this script runs; Only it's giving me everytime

[PHP-DB] Random not working?

2003-03-01 Thread Frank Keessen
Hi All, I'm trying to get a random record each time this script runs; Only it's giving me everytime the first record back.. No random at all.. // generate and execute query $query = SELECT stedenid, naamstad, stadomschrijvk FROM steden ORDER BY RAND() LIMIT 1; $result = mysql_query($query) or

RE: [PHP-DB] random rows...what about tables

2002-12-18 Thread Matthew Moldvan
/ --- -Original Message- From: Hutchins, Richard [mailto:[EMAIL PROTECTED]] Sent: Tuesday, December 17, 2002 9:26 AM To: 'Bruce Levick'; [EMAIL PROTECTED] Subject: RE: [PHP-DB] random rows...what about tables I think it's because mysql_list_tables returns

[PHP-DB] random select

2002-12-17 Thread Bruce Levick
Bruce Levick - VivamotionI was curious as to what is the best way to select a random row from a table in my database. I have currently five rows and will be expanding on that as well. I have tried this code. //retrieve

Re: [PHP-DB] random select

2002-12-17 Thread Jason Wong
On Tuesday 17 December 2002 18:46, Bruce Levick wrote: Bruce Levick - VivamotionI was curious as to what is the best way to select a random row from a table in my database. I have currently five rows and will be expanding on that as well. I have tried this code.

[PHP-DB] random rows...what about tables

2002-12-17 Thread Bruce Levick
Bruce Levick - Vivamotion Been searching for an answer to selecting a random table and then a random row within the selected table. I have this code which successfully selects a random row within a hard coded table. But just can't get the random table working. ?php //trying to select all tables

Re: [PHP-DB] random rows...what about tables

2002-12-17 Thread Jason Wong
On Tuesday 17 December 2002 21:38, Bruce Levick wrote: Bruce Levick - Vivamotion Been searching for an answer to selecting a random table and then a random row within the selected table. I have this code which successfully selects a random row within a hard coded table. But just can't get

Re: [PHP-DB] random rows...what about tables

2002-12-17 Thread Wico de Leeuw
At 23:38 17-12-02 +1000, Bruce Levick wrote: Bruce Levick - Vivamotion Been searching for an answer to selecting a random table and then a random row within the selected table. I have this code which successfully selects a random row within a hard coded table. But just can't get the random table

Re: [PHP-DB] random rows...what about tables

2002-12-17 Thread Bruce Levick
: Jason Wong [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Tuesday, December 17, 2002 11:48 PM Subject: Re: [PHP-DB] random rows...what about tables On Tuesday 17 December 2002 21:38, Bruce Levick wrote: Bruce Levick - Vivamotion Been searching for an answer to selecting a random table

RE: [PHP-DB] random rows...what about tables

2002-12-17 Thread Hutchins, Richard
9:19 AM To: [EMAIL PROTECTED] Subject: Re: [PHP-DB] random rows...what about tables Sorry, Have updated my script with a little help. Upon output i am recieving this. Warning: Argument to array_rand() has to be an array in C:\WORKING\portfolio\vivamotion\site\php\request.php on line 51

Re: [PHP-DB] random rows...what about tables

2002-12-17 Thread Jason Wong
On Tuesday 17 December 2002 22:18, Bruce Levick wrote: Sorry, Have updated my script with a little help. Upon output i am recieving this. Warning: Argument to array_rand() has to be an array in C:\WORKING\portfolio\vivamotion\site\php\request.php on line 51 OK, start from the basics.

[PHP-DB] Random numbers with range in mysql?

2002-09-28 Thread Leif K-Brooks
I'm trying to make shops that sell virtual objects. They restock once every 15 minutes. This is all set up. The problem is, I would like to have objects in these shops with a random chance of being restocked. My idea is to store two numbers in the restock list: chance, and outof. (For a

RE: [PHP-DB] Random numbers with range in mysql?

2002-09-28 Thread John W. Holmes
I'm trying to make shops that sell virtual objects. They restock once every 15 minutes. This is all set up. The problem is, I would like to have objects in these shops with a random chance of being restocked. My idea is to store two numbers in the restock list: chance, and outof. (For a

[PHP-DB] Random

2002-08-11 Thread zhamrock
can someone help me to generate a random records from the database? eg, rec 1 john doe rec 2 jay williams rec 3 anie boo random results: rec 2 jay williams rec 1 john doe rec 3 anie boo . TIA' zham -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit:

[PHP-DB] random

2002-06-04 Thread Natividad Castro
hi to all, I have a drop down menu where users will select a word. After they submit it, I will generate a code number where I want to display the first three characters of the word they selected follow by Month and Date and three number that will be generating randomly. I don't have any problem

Re: [PHP-DB] random

2002-06-04 Thread Jason Wong
On Wednesday 05 June 2002 03:56, Natividad Castro wrote: hi to all, I have a drop down menu where users will select a word. After they submit it, I will generate a code number where I want to display the first three characters of the word they selected follow by Month and Date and three

[PHP-DB] Random Selecting from mySQL

2002-03-13 Thread Georgie Casey
I know how to use the ORDER BY rand() command on the end of queries to randomize selection, but that's no good when you want to only display 10 results per page. The next page the user chooses, randomizes again and could show duplicate fields and not at all show other fields. Does anyone know a

RE: [PHP-DB] Random Selecting from mySQL

2002-03-13 Thread Gurhan Ozen
the results for a given criteria .. Gurhan -Original Message- From: Georgie Casey [mailto:[EMAIL PROTECTED]] Sent: Wednesday, March 13, 2002 2:00 PM To: [EMAIL PROTECTED]; [EMAIL PROTECTED] Subject: [PHP-DB] Random Selecting from mySQL I know how to use the ORDER BY rand() command

Re: [PHP-DB] Random Selecting from mySQL

2002-03-13 Thread Georgie Casey
-- From: Georgie Casey [mailto:[EMAIL PROTECTED]] Sent: Wednesday, March 13, 2002 2:00 PM To: [EMAIL PROTECTED]; [EMAIL PROTECTED] Subject: [PHP-DB] Random Selecting from mySQL I know how to use the ORDER BY rand() command on the end of queries to randomize selection, but that's no good when

RE: [PHP-DB] Random Selecting from mySQL

2002-03-13 Thread Beau Lebens
for you or not. HTH Beau // -Original Message- // From: Georgie Casey [mailto:[EMAIL PROTECTED]] // Sent: Thursday, 14 March 2002 3:00 AM // To: [EMAIL PROTECTED]; [EMAIL PROTECTED] // Subject: [PHP-DB] Random Selecting from mySQL // // // I know how to use the ORDER BY rand() command

RE: [PHP-DB] Random Selecting from mySQL

2002-03-13 Thread Demitrious S. Kelly
element in $seen... thus not allowing duplicates on a per visit basis... -Original Message- From: Georgie Casey [mailto:[EMAIL PROTECTED]] Sent: Wednesday, March 13, 2002 4:11 PM To: [EMAIL PROTECTED]; [EMAIL PROTECTED] Subject: Re: [PHP-DB] Random Selecting from mySQL yea, i know how

[PHP-DB] Random numbers?

2002-02-03 Thread Chris Payne
Hi there everyone, I need to generate a random number between 1 and 15 for insertion into a DB, I can easily do the DB side of it but what is the best method for quickly generating a random number between 1 and 15 (including 1 and 15 in the equation)? Thanks for all your help. Regards Chris

Re: [PHP-DB] Random numbers?

2002-02-03 Thread Patrik Wallstrom
On sön, 03 feb 2002, Chris Payne wrote: Hi there everyone, I need to generate a random number between 1 and 15 for insertion into a DB, I can easily do the DB side of it but what is the best method for quickly generating a random number between 1 and 15 (including 1 and 15 in the

Re: [PHP-DB] Random numbers?

2002-02-03 Thread Chris Payne
Hi there, That is absolutely PERFECT, thank you so much for that you are a lifesaver :-) Regards Chris Payne www.planetoxygene.com On sön, 03 feb 2002, Chris Payne wrote: Hi there everyone, I need to generate a random number between 1 and 15 for insertion into a DB, I can easily

[PHP-DB] Random Row From Database

2001-11-10 Thread HEW Staff
Hi, I'm trying to pull a random row from my database and display the contents. I know that the code: SELECT * FROM TABLENAME WHERE RAND() LIMIT 1 should work. However, there are 19 rows in the database and only the first row ever shows up. Is there a way to do this to ensure uniqueness? The

[PHP-DB] random created numbers and letters

2001-09-25 Thread Saulius Jankauskas
Hello, Can you give me a piece of code, where I could see, how to create random written numbers and letters? For example, I'd like to give my visitor temporary passwrord: BS0147. To another HF0124 and so on... How to generate it with PHP? Sorry, if I didn;t explained clearly what I want.

Re: [PHP-DB] random created numbers and letters

2001-09-25 Thread Andreas D. Landmark
At 25.09.2001 22:46, Saulius Jankauskas wrote: Hello, Can you give me a piece of code, where I could see, how to create random written numbers and letters? For example, I'd like to give my visitor temporary passwrord: BS0147. To another HF0124 and so on... How to generate it with PHP? Sorry,

Re: RE: [PHP-DB] Random

2001-09-03 Thread Russ Michell
know it's documented as rand() but you might want to try random() just in case... I'm sure I read that somewhere - seb -Original Message- From: John Hurleston [mailto:[EMAIL PROTECTED]] Sent: 31 August 2001 19:18 To: [EMAIL PROTECTED] Subject: [PHP-DB] Random I would like

[PHP-DB] Random

2001-08-31 Thread John Hurleston
I would like to get the first 5 random entries out of my mysql database, what would be the correct SELECT option? I adjusted this line $result = mysql_db_query ($DBName,select * from Contacts LIMIT 0,5 ); which works correctly. :) $result = mysql_db_query ($DBName,select * from Contacts order

Re: [PHP-DB] Random

2001-08-31 Thread Chris Hobbs
I was sure there was a syntax error in that SELECT statement, but according tho the description at http://www.mysql.com/doc/M/a/Mathematical_functions.html, that looks right on to me. I know this doesn't help a lot, but at least you've had a second set of eyes confirm that your code looks

Re: [PHP-DB] Random

2001-08-31 Thread Paul Burney
according tho the description at http://www.mysql.com/doc/M/a/Mathematical_functions.html, that looks $result = mysql_db_query ($DBName,select * from Contacts order by rand() LIMIT 5 ); Doesn't work at all. :( What version of MySQL are you using? I remember something about ordering by

RE: [PHP-DB] Random

2001-08-31 Thread Seb Frost
I know it's documented as rand() but you might want to try random() just in case... I'm sure I read that somewhere - seb -Original Message- From: John Hurleston [mailto:[EMAIL PROTECTED]] Sent: 31 August 2001 19:18 To: [EMAIL PROTECTED] Subject: [PHP-DB] Random I would like

[PHP-DB] Random question selection in PHP w/ MySQL backend.

2001-07-31 Thread Adam Lundrigan
I'm having a bit of trouble creating a random question selector. I'm using PHP 4.0.6 and MySQL 3.23.36 on Windows 98 SE. I've tried several different solutions, but none work at all. What i need to do is select 10 questions from a database (db: vpt, table: questions), and make sure that the

Re: [PHP-DB] Random question selection in PHP w/ MySQL backend.

2001-07-31 Thread John Pickett
/xtremist - Original Message - From: Adam Lundrigan [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Tuesday, July 31, 2001 2:32 PM Subject: [PHP-DB] Random question selection in PHP w/ MySQL backend. I'm having a bit of trouble creating a random question selector. I'm using PHP 4.0.6 and MySQL

[PHP-DB] Random Password Generation/MSSQL

2001-07-12 Thread Ryan Marrs
Having an issue with this script, the generator works if I just echo out the password, however when I attempt to update the table, it times-out in IIS. I've bumped the IIS Timeout up to over 20 minutes, and it still times out. This is on a database with approximately 29,000 entries. Any ideas?

RE: [PHP-DB] Random Password Generation/MSSQL

2001-07-12 Thread Mark Roedel
-Original Message- From: Ryan Marrs [mailto:[EMAIL PROTECTED]] Sent: Thursday, July 12, 2001 1:54 PM To: [EMAIL PROTECTED] Subject: [PHP-DB] Random Password Generation/MSSQL Having an issue with this script, the generator works if I just echo out the password, however when I

[PHP-DB] Random - not that random

2001-05-17 Thread Dan Eskildsen
Newbie alert Hi! Here is a piece of coding. It randomly choose between four options to display on my homepage. The problem is that it doesn't seem to be that random - rather biased. The last option $message[3] is displayed 9 out of 10 times. Any suggestions? script language=php

Re: [PHP-DB] Random - not that random

2001-05-17 Thread Ken Wills
Hi Dan, You need to call mt_srand() first to seed the random number generator. It's all described here: http://www.php.net/manual/en/function.mt-rand.php Ken * Dan Eskildsen [EMAIL PROTECTED] [010517 14:22]: Newbie alert Hi! Here is a piece of coding. It randomly choose