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); ?>
2016-10-14, 1233👍, 0💬
Popular Posts:
How to access URL template parameters from "context.Request.Matched Parameters"object in Azure API P...
How To Support Multiple-Page Forms in PHP? If you have a long form with a lots of fields, you may wa...
Where to find tutorials on Using Azure API Management Developer Portal? Here is a list of tutorials ...
Where to find tutorials on RSS specifications? I want to learn it to describe my API services. Here ...
What Is the 2017 Version of Azure API Management Service? The 2017 Version of Azure API Management a...