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

Loading...

Sign in or sign up now!
Alert icon
Upgrade to the latest Flash Player for improved playback performance. Upgrade now or more info.
57,728
Loading...
Alert icon
Sign in or sign up now!
Alert icon

Uploaded by on Jun 7, 2010

Uploading and storing images inside a MySQL database, rather than as a file in a web directory.

Official website
http://phpacademy.org

Support Forum
http://phpacademy.org/forum

Follow us on Twitter!
http://twitter.com/phpacademy

  • likes, 7 dislikes

Link to this comment:

Share to:

Top Comments

  • ***TO ALL WHO GET ERROR***

    Notice: Undefined index: image in C:\xampp\htdocs\xampp\php\uplo­ad_img\index.php on line 22

    This is not something that will cause any problems. Alex from phpacademy would get the same error but he has disabled this type of error and therefor it's not showing.

    THE SOLUTION:

    At the top of the PHP-code, under <?php, add the following code:

    error_reporting(E_ALL ^ E_NOTICE);

    That will stop this error from showing.

    LIKE THIS SO THAT MORE PEOPLE CAN SEE IT!

  • please help erro at:

    Notice: Undefined index: image in C:\xampp\htdocs\xampp\php\uplo­ad picture to data base\index.php on line 22

    please select an image.

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

see all

All Comments (110)

Sign In or Sign Up now to post a comment!
  • can you help me with this error after doing all you've done from part one to part two?..

    "Parse error: syntax error, unexpected T_ELSE in C:\xampp\htdocs\acme_corp1\dis­cussion_file\building_a_cms\hr­efselected\index.php on line 39"

  • and this error:

    Warning: mysql_query() [function.mysql-query]: A link to the server could not be established in C:\Users\Mario\Desktop\General­ Websites\Template 2\xampplite\xampplite\htdocs\P­ortfolio2\Administrator\galler­y\uploadimg.php on line 42 Problem uploading image.

  • I made this tut but it show this error:

    Warning: mysql_query() [function.mysql-query]: Access denied for user 'ODBC'@'localhost' (using password: NO) in C:\Users\Mario\Desktop\General Websites\Template 2\xampplite\xampplite\htdocs\P­ortfolio2\Administrator\galler­y\uploadimg.php on line 42

  • can u pls help me to display my products in different pages categorized by bags, dresses,sandal and accessories...using table databases using php??? this is my projct...huhuhu...pls help me... ds s my email anne_bonch16@yahoo.com

  • image won't display

    

  • @PktMma yeah im looking for that too =/

  • not gayly but i love alex .....aaaaaaaaaalex

  • Wtf, once I write "type="file" the button automatically displays "Choose file - no file chosen". How do I change this if I want it to display in a different language or give a different message?

  • man its nor working. when I write the part checking if you sent something it never shows the content of the image. it just shows me "no file chosen " and the script "error_reporting(E_ALL ^ E_NOTICE);" is not solving the problem, its just ignoring it. when i open the site in my browser it does not fix it!!!

  • the upload is not working. I've followed all the codes and its orientation.. but the upload seemed erroneous. It says problem with the upload. The query for the INSERT INTO tablename is not working properly and everytime I check the database, no data was uploaded.

Loading...

Alert icon
0 / 00Unsaved Playlist Return to active list
    1. Your queue is empty. Add videos to your queue using this button:
      or sign in to load a different list.
    Loading...Loading...Saving...
    • Clear all videos from this list
    • Learn more