danhann9
02-23-2009, 10:56 PM
Hi first post here.
This is my first real experience with PHP and MySQL. I have the following code which allows me to put information from a form into my database.
However I'm having trouble importing one thing. Here is my code.
$item="$_POST[item]";
$price="$_POST[price]";
$description="$_POST[description]";
$picture2=$_FILES['uploadedfile']['name'];
$sql="INSERT INTO items (Name, Description, Price, Button, pic)
VALUES
('$item','$description','$price','$button',../upload/uploads/$picture2)";
if (!mysql_query($sql,$con))
{
die('Error: ' . mysql_error());
}
echo "Thankyou, You have just added $_POST[item] to the database";
I want it to post the file name of the image but also with the "../upload/uploads/"on the beginning of it.
All other items enter fine into the database but i get this error
http://img407.imageshack.us/my.php?image=print.jpg
does anyone have any ideas?
Thanks all
This is my first real experience with PHP and MySQL. I have the following code which allows me to put information from a form into my database.
However I'm having trouble importing one thing. Here is my code.
$item="$_POST[item]";
$price="$_POST[price]";
$description="$_POST[description]";
$picture2=$_FILES['uploadedfile']['name'];
$sql="INSERT INTO items (Name, Description, Price, Button, pic)
VALUES
('$item','$description','$price','$button',../upload/uploads/$picture2)";
if (!mysql_query($sql,$con))
{
die('Error: ' . mysql_error());
}
echo "Thankyou, You have just added $_POST[item] to the database";
I want it to post the file name of the image but also with the "../upload/uploads/"on the beginning of it.
All other items enter fine into the database but i get this error
http://img407.imageshack.us/my.php?image=print.jpg
does anyone have any ideas?
Thanks all