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
Share on other sites

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.

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.