Jump to content

if,elseif not working


rahjiggah

Recommended Posts

Hello,

 

I have a while loop getting a mysql query,

 

Im trying to do an if, elseif,else statement within it but its not working,

 

can anyone see what Im missing?

 

Thx.

 

if ($row['pciaccom']="1" && $row['pciair']="1" || $row['issuerac']="1" && $row['issuerair']="1") {
$acomm = " and paid for accomodations. ";
} elseif ($row['issuerac']="0" && $row['pciaccom']="0") {
$acomm = "";
} elseif ($row['issuerair']="0" && $row['issuerac']="1"]) {
$acomm = " and " . $row['compname'] . " paid for accomodations. ";
} else {
$acomm = " and PooP Co. paid for accomodations. ";
}

Link to comment
https://forums.phpfreaks.com/topic/268565-ifelseif-not-working/
Share on other sites

  Quote

Maybe try...

if (($row['pciaccom']="1" && $row['pciair']="1") ||( $row['issuerac']="1" && $row['issuerair']="1")) {

No.

 

OP: The links provided explain the different between a comparison and an assignment. Look at your code and compare.

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.