0
Saving images in the database
how i can save the images in database uploaded through a form .
4 odpowiedzi
+ 5
You can:
1. Save it as binary data to the database.
2. Upload it to a folder and save the reference/file name to the database. (this one is better)
0
build cover folder for upload image
----------
if(isset($_POST['submit']))
{
$cover=$_FILES['cover']['name'];
$tmp=$_FILES['cover']['tmp_name'];
if($cover)
{
move_uploaded_file($tmp,"cover/$cover");
}
$sql=mysql_query("INSERT INTO table(column_name)VALUES('$cover')")or die("erroruploading".mysql_error());
}
0
thanks than how i can retrieve that file from database to display in a web page
0
use query-->SELECT * FROM tablename
I cannot tell you detail.You can easily find code in stack overflow