Tutorial on Storing and Retriving images along with text from mysql database




This tutorial include storing images in database and retrieve them along with text. For Source code along with database ie .sql file for import. will we here …

source


47 responses to “Tutorial on Storing and Retriving images along with text from mysql database”

  1. When i try to make a binary atrribute it is making me an error with mariadb

    Query error:
    #1064 – You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'BINARY NOT NULL' at line 1

  2. Fantastic tutorial works perfectly and the code supplied works great,  thanks! I have been looking for days for a simple tutorial I could use easily (am a newbie to code at least)and this is the best. Thanks again great work!

  3. Thanks a lot a lot a lot!!! You really help me with my project 😀 just ignore to who say you're boring,, because to me you're really great teacher! 😉 now i understand more.. thanks to you! <3

  4. i get an error, even though the script works, why?

    You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '1' at line 1

  5. form enctype="multipart/form-data" method="post" action="storeinfo.php"
    table border=0 align="center"
    input type="text" name="aname"
    input type="text" name="adetails"
    input type="file" name="aphoto"
    input type="submit" value="store Information

    /form>

  6. $aphoto = addslashes (file_get_contents($_FILES['aphoto']['tmp_name']));
    $image = getimagesize($_FILES['aphoto']['tmp_name']);

    $q="INSERT INTO animaldata VALUES('','$aname','$adetails','$aphoto','$image['mime']')";
    $sql=mysql_query($q);
    if($sql);
    echo "Information Stored Sucess";
    else
    echo mysql_error();
    note you tube uploader shows remove html tags in that reason i have remove my php tage

  7. 1. try to save image file into directory instead of database to check whether uploading script working properly or not
    2. check table field data type in database in which field you are trying to store image to need to be blob and size need to be suitable to store image

  8. this is want i need to do my project..for some reason i cant save the image into my database -.-" i only can save my texts -.-" ive been struggling since 4 days ago..please help me :'(

  9. @srajarjun hi there, i want to upload a blob and text at the same time, but the code in jsp in the form has to be like this for images form name="sdfsd" enctype="multipart/form-data" method="post" and while the text has to be form name="sdfsd" method="get" . I cant seem to upload image and store text even though i aded the enctype and method. How can i upload both text and image at the sametime?

Leave a Reply