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, ∼3234🔥, 0💬
Popular Posts:
Can Multiple Paragraphs Be Included in a List Item? Yes. You can include multiple paragraphs in a si...
How to use "json-to-xml" Azure API Policy Statement? The "json-to-xml" Policy Statement allows you t...
How To Access a Specific Character in a String? Any character in a string can be accessed by a speci...
How to use the "forward-request" Policy Statement to call the backend service for an Azure API servi...
How to build a PHP script to dump Azure AD 2.0 Authentication Response? If you are use the Azure-AD-...