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 DeSaulni

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 t

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 2

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 numb

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 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" || "Con

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" || "Em

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,

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 R

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,

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 Chri

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

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 n

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

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 ea

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 > >

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 my