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 to Web Servers in PHP
⇒⇒PHP Tutorials
2016-10-14, 1560👍, 0💬
Popular Posts:
FYIcenter JSON Validator and Formatter is an online tool that checks for syntax errors of JSON text ...
How to detect errors occurred in the json_decode() call? You can use the following two functions to ...
Where to find tutorials on API Management Services at Azure Portal? Here is a list of tutorials to a...
Where to find tutorials on JSON (JavaScript Object Notation) text string format? I want to know how ...
What is EPUB 2.0 Metadata "dc:date" Element? EPUB 2.0 Metadata "dc:date" is an optional metadata ele...