UPLOAD MULTIPLE IMAGES TO FILE ON SERVER + DISPLAY IMAGE IN TABLE

???
I have some code which i rectified to upload images to server with file path in database.
and view them in table, it works fine (However only 1 image to 1 record)
But what i want to achieve is the following: I want to create a property listings database ,where i can upload say 4 images + the house information on the same upload form ,which is connected to 1 house.
Then run a query for instance by ,bedroom,garages,price etc then the 4 images for that house id must show in a table format for the client to view.
Here is the code 3 files
php_multiple_resize_mysql1.php

ShotDev.Com Tutorial

 






php_multiple_resize_mysql2.php

ShotDev.Com Tutorial <? for($i=0;$i<count($_FILES["fileUpload"]["name"]);$i++) { if(trim($_FILES["fileUpload"]["tmp_name"][$i]) != "") { $images = $_FILES["fileUpload"]["tmp_name"][$i]; $new_images = "thumbnails_".$_FILES["fileUpload"]["name"][$i]; copy($_FILES["fileUpload"]["tmp_name"][$i],"MyResize/".$_FILES["fileUpload"]["name"][$i]); $width=100; //*** Fix Width & Heigh (Autu caculate) ***// $size=GetimageSize($images); $height=round($width*$size[1]/$size[0]); $images_orig = ImageCreateFromJPEG($images); $photoX = ImagesX($images_orig); $photoY = ImagesY($images_orig); $images_fin = ImageCreateTrueColor($width, $height); ImageCopyResampled($images_fin, $images_orig, 0, 0, 0, 0, $width+1, $height+1, $photoX, $photoY); ImageJPEG($images_fin,"MyResize/".$new_images); ImageDestroy($images_orig); ImageDestroy($images_fin);
		echo "Resize Successful.<br>";

		//*** Insert Record ***//
		$objConnect = mysql_connect("localhost","stilbaai_chris","chrisedit52") or die(mysql_error());
		$objDB = mysql_select_db("stilbaai_imageamana");
		$strSQL = "INSERT INTO files ";
		$strSQL .="(Thumbnails,FilesName) VALUES ('".$new_images."','".$_FILES["fileUpload"]["name"][$i]."')";
		$objQuery = mysql_query($strSQL);
	}
}

?>
View file

php_multiple_resize_mysql3.php

ShotDev.Com Tutorial <? $objConnect = mysql_connect("localhost","stilbaai_chris","chrisedit52") or die(mysql_error()); $objDB = mysql_select_db("stilbaai_imageamana"); $strSQL = "SELECT * FROM files"; $objQuery = mysql_query($strSQL) or die ("Error Query [".$strSQL."]"); ?> <? while($objResult = mysql_fetch_array($objQuery)) { ?> <? } ?>
Files ID
Thumbnails
<?=$objResult["FilesID"];?>
"> " border="0">
<? mysql_close($objConnect); ?>
Upload Image
Sponsor our Newsletter | Privacy Policy | Terms of Service