I have coded both the php files with exactly the same code described in the tutorial but the problem is the images are getting stored properly in the mysql database but not getting displayed at the web browser while retrieving it from the database Please help.
Hey! Cool tutorial! But I have a question; If I want to upload more than 1MB than it gives me a connection error. I arranged the "my.ini" and "php.ini" files as stackoverflow says. But right now it does not give me connection error as before but simply says; "Problem uploading image." I don't understand why the query does not work? 🙁 Please help!
if (isset($_FILES['image'])) { $file = $_FILES['image']['tmp_name']; THIS IS WORKING NOW BUT $image = file_get_contents($_FILES['image']['tmp_name']); NOT WORKING
27 responses to “PHP Tutorials Uploading Storing an Image inside a MySQL Database Part 1 YouTube”
Download valide source code: http://atominik.com/2J4s
Warning: mysqli_select_db() expects parameter 1 to be mysqli, string given in H:3338.5root333register.php on line 5
Notice: Undefined index: file in H:3338.5root333register.php on line 8
Notice: Undefined variable: name in H:3338.5root333register.php on line 9
Notice: Undefined variable: name in H:3338.5root333register.php on line 10
Warning: addcslashes() expects exactly 2 parameters, 1 given in C:xampphtdocsForum2profil_test.php on line 32
Warning: addcslashes() expects exactly 2 parameters, 1 given in C:xampphtdocsForum2profil_test.php on line 33
Warning: addcslashes() expects exactly 2 parameters, 1 given in C:xampphtdocsForum2profil_test.php on line 34
Thats not an image.
<?php
// connect to database
mysql_connect("localhost","root","") or die(mysql_error());
mysql_select_db("db_kv_5d") or die(mysql_error());
//file properties
if(isset($_FILES['image'])){
$file = $_FILES['image']['tmp_name'];
}
if (!isset($file))
echo "Please select an image.";
else
{
$image = addcslashes(file_get_contents($_FILES['image']['tmp_name']));
$image_name = addcslashes($_FILES['image']['name']);
$image_size = addcslashes(getimagesize($_FILES['image']['tmp_name']));
if ($image_size==FALSE)
echo "Thats not an image.";
else
{
}
}
?>
what is the file extension you used to store this code?
subi ese hp codigo yaaaaaaa malparido gringo de la mierda subilo yaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
I have coded both the php files with exactly the same code described in the tutorial
but the problem is the images are getting stored properly in the mysql database but
not getting displayed at the web browser while retrieving it from the database Please help.
alex garette?
any source codes?
Thanks. Nice to know that tmp_name is the path of the image. That solved my problem entirely.
Anyone can help me in this?
how to upload multiple images at a time using different blobs and in a single row
Notice: Undefined index: image in C:xampphtdocspracuploadindex.php
Help please. I viewed the comments but it seems nobody can solve this problem.
BEWARE people if you upload a large image and try to echo the tmp directory, it won't show it
now i can use mysqli_real_escape_string() instead of addslashes() right?
Is the source available any where?
i've been following this tutorial
the problem is : Notice: Undefined index: image
how to solve this problem? anyone?
Hey! Cool tutorial!
But I have a question;
If I want to upload more than 1MB than it gives me a connection error. I arranged the "my.ini" and "php.ini" files as stackoverflow says.
But right now it does not give me connection error as before but simply says; "Problem uploading image."
I don't understand why the query does not work? 🙁
Please help!
mine go to if(!isset($file)) even though i selected a file 🙁
VERY CLEAR AND SMART EXPLAIN
THANKS A LOT
my this code is not working i did same as what u did
<html>
<head>
<title>upload</title>
</head>
<body>
<form action='uploadd.php' method='POST' enctype='multipart/form-data' ></br>
File: <input type="file" name= "image" >
<input type="button" value="upload">
</form>
<?php
include("connect.php");
$file = $_FILES['image']['tmp_name'];
if(!isset($file))
echo "Please select image";
else
{
$image = $_FILES['image']['tmp_name'];
$image_name=$_FILES['image']['name'];
$image_size=getimagesize($_FILES['image']['tmp_name']);
if($image_size==FALSE)
echo "this is not image";
else {
}
}
?>
</body>
</html>
how upload image for different profile .. such as for profile picture ..
???
Hi My only problem is that uploader code ie from which you upload picture and it came down can you help me!! ???
if (isset($_FILES['image'])) {
$file = $_FILES['image']['tmp_name'];
THIS IS WORKING NOW BUT
$image = file_get_contents($_FILES['image']['tmp_name']);
NOT WORKING
i got a error :
Notice: Undefined index: image in C:xampphtdocshtdocsvehicledbindex.php on line 18
Alex:
Would you let me know how to increase size of jpeg files that I am storing in mysql table
Thanks.
Bob Ghodsi
PLEASE HELP!!!!!!!!
My php got error when i add
$file = $_FILES['image']['tmp_name']; to my php.
i think it got to do with "<input type="file" name="image">" at the beginning at the <body> tag
This is my error – PHP Notice: Undefined index: image in C:wwwslideshowuploadimage.php