KidsLovePC Contact Us
  Home   PHP  Graphics ASP  JavaScript   J2EE  HTML  JAVA   Swing   Webtip  Forums  Lyric  Free sheet music  Ringtones

Insert binary file into MySQL(BLOB) using PHPMyAdmin

Before you start this lesson, I assume that you finished reading the following tutorials:

  1. install phpmyAdmin, mysql , php
  2. Create Database by using phpMyAdmin
  3. Working with forms
  4. Insert Form Data into Database
  5. Retrieve data from Database

This tutorial will show you how to insert binary files, such as PDF file, image files(JPG,GIF, etc), music files(MP3,mid,etc) using phpMyAdmin.

Create MySql Table

In order to shorten the tutorial, we just create a simple table with 2 columns: one is integer column, the other one is BLOB column to hold the binary file.

Note, there are 4 BLOB types. Each has different storage size:

  1. TINYBLOB: 256bytes
  2. BLOB: 64K bytes
  3. MEDIUMBLOB: 16M bytes
  4. LONGBLOB: 4G bytes

MEDIUMBLOB usually could meet most storage requirement.

Following this lesson Using phpMyAdmin Create Database to create the database,one column is no: int(auto increment) , the other one is image: MEDIUMBLOB. By select auto increment in "Extra" drop down menu like following for column no:

insert binary file into mysql,blob

no column is auto increment so that we don't need insert any value about it.

Insert binary file(image, PDF,..) into MySQL

After you create the table, you will see its name on PHPMyAdmin left panel. Click on it, you will see the following image on the right panel:

insert binary file into mysql,blob

Click on insert, you will see the following image:insert binary file into mysql,blob

The "Browse" button in the above image locate your binary file( such as PDF, images, .exe files, mp3 file, .mid files ... etc). Since column no is auto increment, we don't need insert value for it. Then click on the "GO" button, which is below the above image.

You just inerted an binary file into MySQL database.

There are other alternative ways to insert binary files into MySQL:

  1. Using php programming insert binary files into MySQL
  2. Using HTML Form and php progamming insert binary files into MySQL(local and remote)
  3. Using PhpMyAdmin insert binary files.


PHP Calendar
Comprehensive PHP Web Calendar
Configurable PHP Calendar
PHP Calendar
PHP Image Processing
PHP grahic softwares
PHP create real-time dynamic chart
create antispam image(image verification)
Add water mark to image
PHP Image processing introduction
Add text on Image
Create thumbnail for image
Create image from text on fly
PHP code sample
PHP create dynamic PDF with FPDF
PHP create dynamic PDF with PDFLib
PHP create dynamic PDF with ClibPDF
Improved PHP configurable hit counter
Install phpMyAdmin,MySql, PHP
PhpMyAdmin export/import data
A simple PHP RSS feed reader
PHP include (SSI)
Working with Forms
PHP formmail Generator
Using phpMyAdmin Create Database
Insert Form Data into Database
Retrieve data from Database
Retrieve multiple records
Batch insert text using phpMyAdmin
Using phpMyAdmin insert binary file
Insert binary file using PHP code
Using form insert binary file into MySQL
Retrieve binary file from MySQL
Image hosting business in minutes
Send HTML mail in PHP
Send bulk emails in PHP
Polling/Rating System in PHP
Polling/Rating System in PHP(radio button)
Check visitor's IP address
Check reciprocal link
PHP tutorial
What is PHP?
Install PHP on Windows XP (part1)
Install PHP on Windows XP (part2)
PHP open and closing tags
PHP types
Logic Structures
Include files
Set cookie and delete cookie
Most often used MySQL functions



Printer Inkjet A Z lyricsLearn ChineseHome|PHP|Swing|HTML|JavaScript|ASP|JAVA|Forum|WebTip|Contact Us
Copyright © All rights reserved(new). Privacy|Copyright
designed by

Please help us cover the web site maintenance fee.
barcode scanner Thermal Printer credit card machine bar code printer