how do i insert a image into a directory through MySQL, rename it, generate a link and upload the generated link in MySQL......???

anyhelp will be really apprietiated....

and if its a tutorial its the best way out, i'm not good at PHP.....

plz its urgent for me..

thx alot..

Recommended Answers

All 5 Replies

could u explain more
and in a little detail

try the move_uploaded_file() function to save the file into your directory and create a variable that will create a path to your file in the directory that will be used to store the path in mysql.
it goes something like this..
<?
move_uploaded_file($_FILES,$newimage);
$ewan="../photoupload/";
$ewanko=$ewan . $newimage;
$query="insert into test1 set title='" .$_POST. "',path='$ewanko',memid='$memid'";
mysql_query($query);
}
?>

how do i insert a image into a directory through MySQL, rename it, generate a link and upload the generated link in MySQL......???

anyhelp will be really apprietiated....

and if its a tutorial its the best way out, i'm not good at PHP.....

plz its urgent for me..

thx alot..

I found a great tutorial to do this here: http://www.php-mysql-tutorial.com/upload-to-file-server.php

I figured out a lot from this site!

definitely base on your title you cant use mysql to move your file in the directory. but in php its posible, like ryan was posted..
and the use of mysql there is to save other information in the database
like Description, ImageName, Id, ForeignID etc..

how to insert image into mysql database in php .............
pls give error free code..............,,,,,,,,,,,,,,,,,

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.