sašo-k
9/5/2017 - 9:49 PM

Mysql If condition

Mysql If condition

$sql = "SELECT *,IF(price_promoted != null, IFNULL(price_promoted,price),IFNULL(price_promoted,price)) as amount FROM mod_digishop";
        
$row = self::$db->fetch_all($sql);

return ($row) ? $row : 0;