Hello Robert,
Thursday, April 22, 2004, 8:02:55 PM, you wrote:
RS $cat_id = $cats[id_num];
Try this:
$cat_id = $cats['id_num'];
You need to quote array elements otherwise PHP expects a constant.
--
Best regards,
Richard Davey
http://www.phpcommunity.org/wiki/296.html
--
PHP General
John W. Holmes wrote:
You want instead of ||
if ($cat_id != 53 $cat_id != 54 $cat_id != 55 $cat_id
!= 117 $cat_id != 118 $cat_id != 74)
For stuff like this I've always found the following slightly easier on the
eyes:
if (!in_array($cat_id, array('53', '54', '55', '117', '118', '74')))
What about removing the quotes around the numbers.
if ($cat_id != 53 || $cat_id != 54 || $cat_id != 55 etc...
My IF statement should be picking up on the numbers, and if the number
matches not be displaying out the information, however I look at the
outputted page and the information is
From: Robert Sossomon [EMAIL PROTECTED]
if ($cat_id != 53 || $cat_id != 54 || $cat_id != 55 || $cat_id
!= 117 || $cat_id != 118 || $cat_id != 74)
Okay, if $cat_id is 53, this will work out to:
if(FALSE || TRUE || TRUE || TRUE || TRUE || TRUE)
which results in TRUE overall.
You want
--- Robert Sossomon [EMAIL PROTECTED] wrote:
if ($cat_id != 53 || $cat_id != 54 || $cat_id != 55 || $cat_id
!= 117 || $cat_id != 118 || $cat_id != 74)
That looks like a pretty big logical flaw to me. Just read that out loud
to yourself. It should be clear that this statement is equivalent to:
5 matches
Mail list logo