Re: How to insert a BLOB in mysql?

From: Date: Fri, 09 Mar 2001 15:05:35 +0000
Subject: Re: How to insert a BLOB in mysql?
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-43174@lists.php.net to get a copy of this message
works great. I use it on a few sites. time.egn has a simple mtime() function and database.egn are just my sql wrappers. <?php include_once('database.egn'); include_once('time.egn'); if ($db_file != 'none' AND $db_file AND is_uploaded_file($db_file) AND filesize($db_file)) { $db_file = addslashes(fread(fopen($db_file, 'r'), filesize($db_file))); $db_file_id = mtime(); insert_db_value('images', " '$db_file_id', '$db_file', '$db_file_name', '$db_file_type' "); } echo " <html> <body> <form method=post enctype='multipart/form-data' action='$PHP_SELF'> <input type=file name=db_file> <input type=submit> </form> </body> </html> "; ?> -- Chris Lee Mediawaveonline.com ph. 250.377.1095 ph. 250.376.2690 fx. 250.554.1120 lee@mediawaveonline.com "Daniele" <tribal@net24.it> wrote in message news:5.0.2.1.2.20010309121957.00af1180@popmail.libero.it... A friend ask me how to insert image and other binary in his mysql db. He don't want to insert the link to the file, he want insert the file itself.. I looking for some tutorial but i don't find anything... I would like to know how i can do it in php and with the shell of mysql...and if this works fine. thanks!! daniele -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: php-general-unsubscribe@lists.php.net For additional commands, e-mail: php-general-help@lists.php.net To contact the list administrators, e-mail: php-list-admin@lists.php.net

« previous php.general (#43174) next »