Pls !!!
Posted: Thu May 13, 2004 12:30 am
is the following coding correct if i 1 to edit a image....can check for me ??thankz!!!
settype($pid,"integer");
settype($pPrice,"double");
if ($imgName=="")
{
$fileName = $imgID;
}
else
{
$fileName = $imgName;
}
$sql = "update products set categoryID = '$cid',
price=$pPrice ,description='$descripe', image_src='$fileName' where productID = $pid ";
$result = mysql_query($sql,$Adb);
if($result)
{
echo "<script>alert('You had updated product details. Thank you.')
location.href ='adminmainpage.php'</script>";
}
else
{
echo "<script>alert('Sorry, error occur when you edit product details. Please edit again.')
location.href ='editProduct.php'</script>";
}
settype($pid,"integer");
settype($pPrice,"double");
if ($imgName=="")
{
$fileName = $imgID;
}
else
{
$fileName = $imgName;
}
$sql = "update products set categoryID = '$cid',
price=$pPrice ,description='$descripe', image_src='$fileName' where productID = $pid ";
$result = mysql_query($sql,$Adb);
if($result)
{
echo "<script>alert('You had updated product details. Thank you.')
location.href ='adminmainpage.php'</script>";
}
else
{
echo "<script>alert('Sorry, error occur when you edit product details. Please edit again.')
location.href ='editProduct.php'</script>";
}