Jump to content

[SOLVED] Correct way to write this...


DBookatay

Recommended Posts

if ($row['body'] == "Dump" OR == "Rack Body")
   { **** DO THIS *** }

 

How do you write an if statement like this?

I've tried:

if ($row['body'] == "Dump" OR  "Rack Body")
   { **** DO THIS *** }

and:

if ($row['body'] == "Dump" || "Rack Body")
   { **** DO THIS *** }

neither of which work.

 

The full statement I am trying to do is:

if ($row['price_KBB'] != "0") {
   $kbbPrice = "$".number_format($row['price_KBB']);
   $kbb = "Yes";
}
elseif ($row['body'] == "Dump" OR "Rack Body") {
   $kbbPrice = '<span class="red">*** N / A ***</span>';
   $kbb = "Commercial";
} else {
   $kbb = "No";
}

Link to comment
https://forums.phpfreaks.com/topic/87475-solved-correct-way-to-write-this/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.