A MySQL database can be used to store files uploaded using PHP.The table columns must be created using BLOB columns to hold the binary file.The blob column can hold up to 65,535 characters.
Example code:
<?php $con = mysql_connect("localhost", "", ""); mysql_select_db("w3m"); $sql = "CREATE TABLE updfiles (" . " id INTEGER NOT NULL AUTO_INCREMENT" . ", name VARCHAR(80) NOT NULL" . ", type VARCHAR(80) NOT NULL" . ", size INTEGER NOT NULL" . ", content BLOB" . ", PRIMARY KEY (id)" . ")"; mysql_query($sql, $con); mysql_close($con); ?>
Tags: blob, database, file, upload
[...] original here: PHP File Handling | Upload and store files in Mysql using PHP … Share and [...]