$select="select max(p_id) AS p_id from product";
$result=mysql_query($select);
$read=mysql_fetch_array($result);
echo $read['p_id'];
$total2=$_POST['total'];
if (!defined('UPLOADDIR'))
define('UPLOADDIR', (dirname(__FILE__) . "./image_product"));
//checks if file uploaded file1
if (is_uploaded_file($_FILES['p_pic']['tmp_name'])) {
/*
* $File_tmpname = get file temporary name
* $File_name = get file name
* $File_type = get file type
* $File_size = get file size
*
*/
$File_tmpname = $_FILES["p_pic"]["tmp_name"];
$File_name = $_FILES["p_pic"]["name"];
$File_type = $_FILES["p_pic"]["type"];
$File_extension = substr($File_type, (strrpos($File_type, "/") + 1));
$File_size = $_FILES["p_pic"]["size"];
//checks if file moved successfull
$path_img = "";
if (move_uploaded_file($File_tmpname, (UPLOADDIR . "/" . $File_name))) {
//echo "<br>File uploading successful.";
$path_img = "./image_product/".$File_name;
}
}
$updateproduct = "update product set p_price='$total2' , p_pic='$path_img' where p_id='$p_id' ";
mysql_query($updateproduct);
$productdetail = 1;
foreach($sess_basket as $m_id =>$value){
$selectprice="select * from material where m_id='$m_id' ";
$resultprice=mysql_query($selectprice);
while($readprice=mysql_fetch_array($resultprice)){