I have a strange problem.
If have function that does this return the value,
public function isVipCustomer($customer_id){
$cus_vip_id=FALSE;
$sql="SELECT customerid FROM customers WHERE is_vip='1'
AND customerid='".$customer_id."' LIMIT 0,1 ";
$result= $this->db->query($sql);
while($row=mysqli_fetch_assoc($result)){
$cus_vip_id=(int)$row['customerid'];
}
if($cus_vip_id!=0)
return TRUE;
else
return FALSE;
}
when I call
$customer_id=13;
echo $collection->isVipCustomer($customer_id);
when its true it outputs 1 but when its false its empty, expecting a output of 0
why?
From the PHP documentation:
http://www.php.net/manual/en/language.types.string.php
To print the return value back with the type, try using
var_dump($myVar)instead.