Search the Community
Showing results for tags 'uploading image'.
-
I am trying to save images in my database from HTML form. I have written PHP code to accomplish this task. Its giving me the following error message,and not inserting data in the database. Kindly check it. Here i am sharing a excerpt from my code. I am using BLOB for image. /*------------------- IMAGE QUERY ---------------*/ $file =$_FILES['image']['tmp_name']; if(!isset($file)) { echo 'Please select an Image'; } else { $image_check= getimagesize($_FILES['image']['tmp_name']); if($image_check==false) { echo 'Not a Valid Image'; } else { $image =file_get_contents ($_FILES['image']['tmp_name'] ); $image_name =$_FILES['image']['name']; if ($image_query =mysql_query ("insert into product_images values (1,'$image_name',$image )")) { echo $current_id; //echo 'Successfull'; } else { echo mysql_error(); } } } /*----------------- IMAGE QUERY END ---------------------*/ <form action='insert_product.php' method='POST' enctype='multipart/form-data' ></br> File : <input type='file' name= 'image' > </form> Error Message
- 4 replies
-
- mysql database
- uploading image
-
(and 2 more)
Tagged with: