Sunday, December 14, 2014

HOW TO STORE IMAGE IN SQL DATABASE DIRECTLY

What you really need?
  • USBwebserver or any other tools Xampp etc.
1) create a new folder [images] inside root folder

2) inside images folder, insert any picture you would like to store into database. say, i use below picture and name it arrow.jpg (use simple/short name)

3) Sign in into PHP Admin, Username: root , Password: usbw


4) create new database , and name it 'image' 

5) inside image database, create a table 'img' with 2 columns .
  • name: id - type: INT - length: 3 - AI: tick
  • name: path - type: VARCHAR - length: 200 


6) press INSERT tab at the top and fill in the value as shown in the figure below:
  • for path, write in the name of the folder [images] and followed by the image's name [arrow.jpg] :           images/arrow.jpg

SO WE ONLY FINISH THE FIRST STEP. LETS HIT THE NEXT ONE..

No comments:

Post a Comment