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 ||
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
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
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 ||
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
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
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,
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
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
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
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
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
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.
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
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
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
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
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
18 matches
Mail list logo