Damiko Gutom - 2013-10-28 04:58:45
Hi, i'm trying select column with conditional statement, however. it throws an error saying this field is unknown.
$fields = array('id','anime_name','volume',
'(CASE WHEN (DATEDIFF(now(),last_update)) < 2 THEN "new" ELSE NULL END) as update_status');
$sql = MySQL::BuildSQLSelect($table_name,$values,$fields,$sortby,true, $limit);
it gives me We caught the error: Unknown column '(CASE WHEN (DATEDIFF(now(),last_update)) < 2 THEN "new" ELSE NULL END) as update_status' in 'field list' (1509)