I’m trying to show values from a database using mssql, if there is a value in the shipp_attn field, I will display that, if that is missing, I will display the shipname, and if that is missing I will display the order number which I know is there.
This is the code I have for it:
if($ShipAttn != “”){
echo”<a href=”./PendingOrders.php?OID=$OrderID”>$ShipAttn (Order Number: $OrderID)</a><br>”;
}elseif($ShipName != “”){
echo”<a href=”./PendingOrders.php?OID=$OrderID”>$ShipName (Order Number: $OrderID)</a><br>”;
}else{
echo”<a href=”./PendingOrders.php?OID=$OrderID”>(Order Number: $OrderID)</a><br>”;
}
This code works fine so long as there is a <null> in the shipp_attn($ShipAttn) field, however some of the missing values simply have nothing in the field instead of <null> and my code will not recognize that as “”, null, or not being set, as I have tried all seperately and together. When one of these fields comes up it will not jump to the elseif($ShipName != “”) part and it will display..nothing. I have no idea why it is doing this, would anyone be able to lend a hand?
I added those (Order Number: $OrderID)’s in as a temporary solution, but I would like to have this work as I had planned out.