How do i insert this into my sql database? I have tried a few things like putting the array bracks on the upload file. when i do this it saves the image location but doesnt upload the image.
This is my upload snippet
for ($i=0;$i<4;$i++)
{
if($_FILES['userfile']['name'][$i])
{
$uploadfile = $uploaddir . basename($_FILES['userfile']['name'][$i]);
$ext = strtolower(substr($uploadfile,strlen($uploadfile)-3,3));
if (preg_match("/(jpg|gif|png|bmp)/",$ext))
{
if (move_uploaded_file($_FILES['userfile']['tmp_name'][$i], $uploadfile))
}
My insert snippet looks like this;
$qry = "INSERT INTO properties(photourl,photourl2) VALUES('$userfile[1]','$userfile[0]')";
$result = @mysql_query($qry);
//Check whether the query was successful or not
if($result) {
header("location: register-success.php");
exit();
}else {
die("Query WTF failed");
}
as it is now i get no error , but the fields are empty .