DBookatay Posted January 24, 2008 Share Posted January 24, 2008 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 More sharing options...
awpti Posted January 24, 2008 Share Posted January 24, 2008 elseif ($row['body'] == "Dump" || $row['body'] == "Rack Body") { Link to comment https://forums.phpfreaks.com/topic/87475-solved-correct-way-to-write-this/#findComment-447408 Share on other sites More sharing options...
DBookatay Posted January 24, 2008 Author Share Posted January 24, 2008 elseif ($row['body'] == "Dump" || $row['body'] == "Rack Body") { Thank you, I had a brain fart and just couldnt figure it out... Link to comment https://forums.phpfreaks.com/topic/87475-solved-correct-way-to-write-this/#findComment-447410 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.