Click here to Skip to main content
13,635,085 members
Rate this:
 
Please Sign up or sign in to vote.
See more:
<?php
mysql_connect("localhost", "root","") or die ("could not connect to the server");
mysql_select_db("demodemo") or die ("that database could not be found");

$file = $_FILES['image']['tmp_name'];

$image= addslashes(file_get_contents($_FILES['image']['tmp_name']));
$image_name = addslashes($_FILES['image']['name']);
$image_size = getimagesize($_FILES['image']['tmp_name']);

mysql_query("INSERT INTO image (id,image) VALUES ('1','{$image}')");
?>

What I have tried:

i have a tried..


<?php
mysql_connect("localhost", "root","") or die ("could not connect to the server");
mysql_select_db("demodemo") or die ("that database could not be found");

$file = $_FILES['image']['tmp_name'];

$image= addslashes(file_get_contents($_FILES['image']['tmp_name']));
$image_name = addslashes($_FILES['image']['name']);
$image_size = getimagesize($_FILES['image']['tmp_name']);

mysql_query("INSERT INTO image (id,image) VALUES ('1','{$image}')");
?>
Posted 19-Jun-18 1:41am

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
Top Experts
Last 24hrsThis month


Advertise | Privacy | Cookies | Terms of Service
Web04-2016 | 2.8.180712.1 | Last Updated 19 Jun 2018
Copyright © CodeProject, 1999-2018
All Rights Reserved.
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100