Page 1 of 1

Pls !!!

Posted: Thu May 13, 2004 12:30 am
by enefahchen
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>";
}

    Posted: Thu May 13, 2004 7:05 am
    by launchcode
    Hard to tell without seeing all of the script, but there is nothing obviously wrong with the above, for what there is of it anyway.