How to save image using PHP MySQL
I have very simple way to store image in mysql databases. I will describe how to save images in MySQL and display it using PHP.
The first step, we need to make a MySQL databases to store our images data. Make a database called “images” on your MySQL database, then create a table called “imagesdata”.
CREATE TABLE `imagesdata` (
`id` int(6) NOT NULL AUTO_INCREMENT,
`image` longtext NOT NULL,
`dates` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
PRIMARY KEY (`id`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1 AUTO_INCREMENT=1 ;
I got a problem when trying to import SQL file using PHPMyAdmin. my PHPMyAdmin allow import file with max size 2M, actually my SQL file has 16MB. You can solve this problem by editing the php.ini file.



