Pls !!!

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
enefahchen
Forum Newbie
Posts: 10
Joined: Wed May 12, 2004 1:35 am

Pls !!!

Post 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>";
}
    User avatar
    launchcode
    Forum Contributor
    Posts: 401
    Joined: Tue May 11, 2004 7:32 pm
    Location: UK
    Contact:

    Post 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.
    Post Reply