Guidance:If you want to put binary data, suchImageFiles and HTML files are directly stored in yourMySQL databaseSo this article is for you! I will show you how to store these files through HTML forms and how to access and use these files. The following sections will solve these problems and teach you how to store images directly in the MySQL database.
Overview:
Create a new database in mysql
Example program for storing files
Example program on how to access a file
Create a new database in mysql
First, you must create a new database in your mysql database. We will store those binary files in this database. In this example, I will use the following structure. To create a database, you must perform the following steps:
The following is a reference clip:
Go to MySql Controller
Enter the command "create database binary_data ;"
Enter the command "use binary_data ;"
Enter the command "create table binary_data (id INT (4) not null AUTO_INCREMENT primary key,
Description CHAR (50), bin_data LONGBLOB, filename CHAR (50), filesize CHAR (50), filetype CHAR (50); "the row cannot be broken)
If there is no accident, the database and table should be created.