Sign up ×
Stack Overflow is a community of 4.7 million programmers, just like you, helping each other. Join them, it only takes a minute:

I have absolutely no Idea what to do so please help me.

I have a Database Table that contains BLOB for Image, text, numeric fields. I have accomplished to retrieve the data from the Table by sending a request from Javascript to PHP tru AJAX by this steps.

  1. Create a AJAX request from javascript using POST method . I passed the SQL fom the post method.
  2. Process the $_POST["SQL"] and retrieve the data from mysql database. Using mysqli_query.
  3. I use mysqli_fetch_array to convert the result to an associative array.
  4. I use echo json_encode to have a JSON string as an output then echo it.

My problem starts here since the field that contains the BLOB image has 'null' value while other fields behave perfectly fine.

Take note that I'm not only retrieving the Image field but multiple fields.

I'm new to web development and I am using Javascript( not Jquery ) and PHP.

What should I do?

Thank you in advance!

share|improve this question
1  
why to use DB for storing image , whay not upload the image on the server and store its path in DB – Satya Aug 30 '13 at 4:56
    
Tnx for the reply. I have to do this so that when migrating the application to other server, I would just have to collect the scripts and database. I dont have to worry about the images since it is included in the database already. – Jenerson Jose Aug 30 '13 at 5:04
    
Output (blob) image without encoding. Look here: stackoverflow.com/questions/1760754/… – Andrew Aug 30 '13 at 5:41

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Browse other questions tagged or ask your own question.