Wednesday, 11 September 2013

how to image path insert in myql?

how to image path insert in myql?

I'd like to include in my MySQL table a path to an image. The image path
gets into the table by inserting the value of a "file" textfield (one of
those Browse kind of deals). So the value that gets entered is something
like: image001.jpg. But I can't seem to use that value to put an image
into a html page. if it goes into the table fine, why can't I get it out?
I upload an image but I don't know where it's gone. Because there's no
value entered in image field when I checked it through PhpMyadmin.
Table schema
CREATE TABLE employee_details
(
emp_image varchar(255),
employee_name varchar(50),
employee_address varchar(50),
employee_designation varchar(50),
employee_salary int(),
);
Query
$sql="
INSERT INTO employee_detail(
emp_image,
employee_name,
employee_address,
employee_contact,
employee_designation,
employee_salary
)
VALUES(
'$_POST[emp_image]',
'$_POST[employee_name]',
'$_POST[employee_address]',
'$_POST[employee_contact]',
'$_POST[employee_designation]',
'$_POST[employee_salary]'
)";

No comments:

Post a Comment