PHP saves images to the mysql implementation code. The php Tutorial saves images to mysql. the implementation code below only shows you how to save images to a database. this method is not recommended. * Mysql_connect (localhost, root, r php Tutorial stores images into mysql tutorial implementation code
The following describes how to save images to a database. this method is not recommended.
*/
Mysql_connect ('localhost', 'root', 'root ');
Mysql_select_db ('AC ');
$ Picdir = "/a/ag.gif ";
$ Image = addslashes (file_get_contents ($ picdir ));
$ SQL = "insert into tbl_name (field) values ('". $ image ."')";
Mysql_query ($ SQL );
/*
--
-- Table structure 'test'
--
Create table if not exists 'test '(
'Id' int (8) not null auto_increment,
'Title' char (150) default null,
'Content' longblob,
'Addnewcolumn' varchar (20) not null,
Primary key ('id ')
) Engine = myisam default charset = utf8 auto_increment = 1;
The tutorial below only shows you how to save images to the database. this method is not recommended. */Mysql_connect ('localhost', 'root', 'R...