PHP Tutorials: Uploading/Storing an Image inside a MySQL Database (Part 1)

Posted by: Admin  :  Category: Mysql

Linux Cpanel shared hosting: 600 GB disk space, 6 TB bandwidth, free domain, unlimited databases and ftp accounts, web hosting cheap and pro at Hostony

Linux Cpanel shared hosting: 600 GB disk space, 6 TB bandwidth, free domain, unlimited databases and ftp accounts, web hosting cheap and pro at Hostony

Uploading and storing images inside a MySQL database, rather than as a file in a web directory. Visit the forum for help! phpacademy.info Follow on Twitter! twitter.com
Video Rating: 4 / 5

Linux Cpanel shared hosting: 600 GB disk space, 6 TB bandwidth, free domain, unlimited databases and ftp accounts, web hosting cheap and pro at Hostony

25 Responses to “PHP Tutorials: Uploading/Storing an Image inside a MySQL Database (Part 1)”

  1. Acceptable76 Says:

    lol the undefined index’s are normal – hide them with “error_reporting(0); “

  2. killerboduk999 Says:

    @am84pm hey if you see an php chat tutorial just pm plssss…i need a private chat ill add to my site…

  3. am84pm Says:

    @killerboduk999 I try to change it. I’m using php5 .thanks for the advice mate.

  4. killerboduk999 Says:

    @am84pm hahaha theres a new video image uploading site…

    i think your problem was the php version try to google if(isset($_POST[”submit]))
    {
    code here/////////////
    }

  5. am84pm Says:

    @killerboduk999 I don’t why he is not responding…… I must go and get another tutorial…

  6. killerboduk999 Says:

    @am84pm not yet 🙁

  7. am84pm Says:

    @mrjonesgl Same problem for me

  8. am84pm Says:

    @killerboduk999 I have the same problem. have you got the answer?

  9. kil1crazy Says:

    For those people getting the “Notice: Undefined index: image in C:wampw w wFolderindex.php on line 19, where $file = $_FILES[‘image’] [‘tmp_name’]” Error,

    I founf that this seems to work:

    if (isset($_FILES[‘image’]))
    {
    $file = $_FILES[‘image’][‘tmp_name’];
    }

    hope this helps 🙂

  10. mkcircles Says:

    Alex thanks so much for the tutorials. How about for several images?

  11. exercitius Says:

    how can you do this for more than 1 image? An to keep all images in the same row of the database.

  12. Speendrift Says:

    No matter what I do all the error messages display, even though the image is successfully uploaded to the database table.

    The problem seemsto come from incorrectly placed function brackets; I’ve tried all I could but am at a loss. It works, but it’s ugly.

    Anyone knows where to find the file so that I can compare it with what I have?

    Cheers!!!

  13. killerboduk999 Says:

    please help erro at:

    Notice: Undefined index: image in C:xampphtdocsxamppphpupload picture to data baseindex.php on line 22
    please select an image.

    i finished the program its working now… but i get this error..

  14. JDsiteworks Says:

    how can i convert to multiple uploader. please help thnks

  15. phpfreak1 Says:

    how do you upload tons of pictures at a time

  16. HawxTeamDelta Says:

    @1EverythingFunny1 you should not be here if you dont know that

  17. ahmedebeid Says:

    @santed phpro.org/tutorials/Storing-Images-in-MySQL-with-PHP.html#7

  18. santed Says:

    hi Alex,

    this is very helpful, but i am getting an error

    Notice: Undefined index: image in C:wampw w wFolderindex.php on line 19, where $file = $_FILES[‘image’] [‘tmp_name’]; at 10:50 on video as an error but when i echo it seems to show the tmp location,

    any ideas?

    Thanks alot

  19. santed Says:

    @ahmedebeid @phpacademy
    yes please im having the same problem. i think there is no answer for this…

  20. nightmrmms Says:

    i need this but in jsp 🙁

  21. Sikeman214 Says:

    @1EverythingFunny1 why would he do that? so easy theres only like 3 vids on it. Search!!!!!!

  22. 1EverythingFunny1 Says:

    make a video showing how to setup phpmyadmin

  23. mrjonesgl Says:

    i get the same error.
    Undefined index: image in C:wampw w wFolderindex.php on line 19, where $file = $_FILES[‘image’] [‘tmp_name’]; at 10:50

  24. dreamer2580 Says:

    thanks to you! helped a lot!

  25. ahmedebeid Says:

    @phpacademy
    hi Alex,
    this is very helpful, but i am getting an error
    Notice: Undefined index: image in C:wampw w wFolderindex.php on line 19, where $file = $_FILES[‘image’] [‘tmp_name’]; at 10:50 on video as an error but when i echo it seems to show the tmp location,
    any ideas?
    Thanks alot

Leave a Reply

*