Tools, FAQ, Tutorials:
Creating a Database Table to Store Files in PHP
How To Create a Table To Store Files in PHP?
✍: FYIcenter.com
If you using MySQL database and want to store files in database, you need to create BLOB columns, which can holds up to 65,535 characters. Here is a sample script that creates a table with a BLOB column to be used to store uploaded files:
<?php
$con = mysql_connect("localhost", "", "");
mysql_select_db("fyi");
$sql = "CREATE TABLE fyi_files ("
. " 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);
?>
⇒ Uploading Files into Database in PHP
⇐ Filtering Out Empty Files in PHP
2016-10-14, ∼2911🔥, 0💬
Popular Posts:
Where to find tutorials on HTML language? I want to know how to learn HTML. Here is a large collecti...
What is EPUB 3.0 Metadata "dcterms:modified" property? EPUB 3.0 Metadata "dcterms:modified" is a req...
How To Create an Array with a Sequence of Integers or Characters in PHP? The quickest way to create ...
Where can I download the EPUB 2.0 sample book "The Problems of Philosophy" by Lewis Theme? You can f...
How to use the "Ctrl-p Ctrl-q" sequence to detach console from the TTY terminal of container's runni...