close ad
 
Important WebAssist Announcement
open ad
View Menu

Technical Support Forums

Free, outstanding support from WebAssist and your colleagues

PHP Show if...working with two values?

Thread began 10/14/2014 6:57 am by Nathon Jones Web Design | Last modified 10/28/2014 7:56 am by Nathon Jones Web Design | 3051 views | 15 replies

Nathon Jones Web Design

Sorry, wee bit of confusion here. I don't think you've misread anything! At the moment I have this:

<?php if ($row_rsPROD['LEDtypeID'] != 6 && $row_rsPROD['LEDtypeID'] != 9) { // Show if column... ?>
Content
<?php } // Show if column... ?>

When the typeID is not either 6 or 9 the "Content" displays. However if I change this to the OR operator, II, then the content does display even if the typeID is 6 or 9? typeID can only be one value so the OR operator seems like the correct choice however it doesn't work.

This product (http://www.ledwarehouseuk.com/LED-Lights-Bulbs.php?lbid=659), for example, has a typeID of 6 yet if I use this:

<?php if ($row_rsPROD['LEDtypeID'] != 6 || $row_rsPROD['LEDtypeID'] != 9) { // Show if column... ?>
Content
<?php } // Show if column... ?>

The "Content" is displayed. Shouldn't it be hidden?


Moving on from the above, can I include another AND or OR clause using a different field from my recordset? I'm trying to cover a scenario where we display "Content" but only if the LEDtypeID is not either "6" or "9" OR LEDid is not "610".

<?php if (($row_rsPROD['LEDtypeID'] != 6 && $row_rsPROD['LEDtypeID'] != 9)) || $row_rsPROD['LEDid'] != 610 { // Show if column... ?>
Content
<?php } // Show if column... ?>

...but obviously I'd need to sort out the initial issue before proceeding with the above. Hope you can help.
Thank you.
NJ

Build websites with a little help from your friends

Your friends over here at WebAssist! These Dreamweaver extensions will assist you in building unlimited, custom websites.

Build websites from already-built web applications

These out-of-the-box solutions provide you proven, tested applications that can be up and running now.  Build a store, a gallery, or a web-based email solution.

Want your website pre-built and hosted?

Close Windowclose

Rate your experience or provide feedback on this page

Account or customer service questions?
Please user our contact form.

Need technical support?
Please visit support to ask a question

Content

rating

Layout

rating

Ease of use

rating

security code refresh image

We do not respond to comments submitted from this page directly, but we do read and analyze any feedback and will use it to help make your experience better in the future.

Close Windowclose

We were unable to retrieve the attached file

Close Windowclose

Attach and remove files

add attachmentAdd attachment
Close Windowclose

Enter the URL you would like to link to in your post

Close Windowclose

This is how you use right click RTF editing

Enable right click RTF editing option allows you to add html markup into your tutorial such as images, bulleted lists, files and more...

-- click to close --

Uploading file...