lilman Posted November 17, 2006 Share Posted November 17, 2006 I want to insert images into a database, but not sure exactly how to do this. Does anyone have any suggestions on how I can do this? The reason for wanting to do this, is for a hot or not script. Link to comment https://forums.phpfreaks.com/topic/27621-mysql-php-images/ Share on other sites More sharing options...
printf Posted November 17, 2006 Share Posted November 17, 2006 Why not just store the path in the database, and store the file on the system... Link to comment https://forums.phpfreaks.com/topic/27621-mysql-php-images/#findComment-126320 Share on other sites More sharing options...
lilman Posted November 17, 2006 Author Share Posted November 17, 2006 Interesting you say that, I was just thinking about that when I submitted this thread. I will probably do that... but is it possible to store a image in a MySQL database? Link to comment https://forums.phpfreaks.com/topic/27621-mysql-php-images/#findComment-126324 Share on other sites More sharing options...
printf Posted November 17, 2006 Share Posted November 17, 2006 ya just use a BLOB type column, and you should be fine...example of what a database table might look like...[code]CREATE TABLE `files` ( `id` int(10) unsigned NOT NULL auto_increment, `name` varchar(64) NOT NULL, `type` varchar(4) NOT NULL, `size` int(10) unsigned NOT NULL default '0', `dtime` datetime NOT NULL, `data` blob NOT NULL, PRIMARY KEY (`id`), KEY `name` (`name`,`size`), KEY `dtime` (`dtime`)) ENGINE=MyISAM;[/code] Link to comment https://forums.phpfreaks.com/topic/27621-mysql-php-images/#findComment-126331 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.