This is the select statement
- Code: Select all
{
# search on license number
$l_name=$_POST["l_name"];
$stmt = $this->db->prepare('SELECT id,image,license_num,l_name,f_name,DATE_FORMAT(birth_d,\'%e-%m-%Y\') AS birth ,DATE_FORMAT(expires,\'%e-%m-%Y\') AS
expires,license_type,license_status,CASE WHEN CURDATE( ) >= `expires` THEN \'Expired\' ELSE \'Not Expired\' END AS status FROM license WHERE l_name=?');
//-- DUMP ( CAST ( image AS image( 50 ) ) )
$stmt->bind_param("s",$l_name);
$stmt->execute();
$stmt->bind_result($id,$image,$license_num,$l_name,$f_name,$birth,$expires,$license_type,$license_status,$status);
}
and this is the Json
- Code: Select all
$result[] = array(
"image"=>$image,
"license_num"=>$license_num,
"l_name"=>$l_name,
"f_name"=>$f_name,
"birth"=>$birth,
"expires"=>$expires,
"license_type"=>$license_type,
"license_status"=>$license_status,
"status"=>$status,

