Getting BLOB to return binary data

Links for php scripts

Moderators: macek, egami, gesf

New php-forum User
New php-forum User
Posts: 1
Joined: Tue Oct 02, 2012 4:52 pm

Getting BLOB to return binary data

Postby kemnet » Tue Oct 02, 2012 4:56 pm

I have an issue. I have a database an PHP scripts. In the database there is an image field of image data type that stores the path to an image. Then in my query select * from table I get the image. How ever I changed the image data type to BLOB and uploaded the image in the database . How ever when i say the select statement on the table in the image field I get null. I was really hoping to know if there was some function I have to run on the image field (blob data type) so I could get the binary data of the images as the functions I see I don't really get. Thanks

This is the select statement

Code: Select all

    # search on license number

 $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 ) ) )

and this is the Json

Code: Select all

            $result[] = array(

Return to “PHP Scripts”

Who is online

Users browsing this forum: No registered users and 1 guest