swatisonee wrote:i'm puzzled - how would the path be defined in the INSERT query pl ?
$sql = "INSERT INTO TABLE X ("Imagelocation") VALUES ( '$????' )" ;
What would $???? be ?
thanks.
Well, if you're processing a file upload of some sort, it might be something like:
$uploadDir = $_SERVER['DOCUMENT_ROOT'].'/uploads/';
$fileName = basename($_FILES['file']['tmp_name']);
if(move_uploaded_file($_FILES['file']['tmp_name'], $uploadDir.$fileName))
{
$sql = "INSERT INTO TABLE X (`ImageDirectory`, `ImageFileName`) VALUES ('$uploadDir', '$fileName')";
// perform insert query and any other processing...
}
else
{
// throw exception or raise error
}