Can anybody tell me why this is not working - I think I've tried just about everything and am stuck.
I get an array from a form post (the data originally comes from MySQL database) and sort it out into separate variables
$supplier = $_POST[suppliers_info];
$supplierarray = explode(",",$supplier);
$supplierEmail = $supplierarray[0];
$supplierId = $supplierarray[1];
$supplierEmail2 = $supplierarray[2];
Now sometimes the variable $supplierEmail2 will have a value assigned to it, sometimes not. I currently have the data in the database set to 'none' but had it set to null initially.
if ($supplierEmail2 == 'none')
{
echo "No email" . "<br />";
} else
{
echo $supplierEmail2 . "<br />";
}
no matter what I try this always echo's the $supplierEmail2 variable even though in the above example $supplierEmail2 is actually 'none'. When the field was NULL I tried:
if ( empty($supplierEmail2) )
{
echo "No email";
} else
{
echo $supplierEmail2 . "<br />";
}
I've also tried testing the strlen etc.
I must be doing something very wrong somewhere but cannot see where.