hi, i got a webpage where it will insert user profile into database and upload their photos into server..
$addQuery="INSERT into user_tbl(userID,....)VALUES('".$userID."',...)";
mysql_query($addQuery)or die('Error, update query failed');
/*******************************
Upload img to folder uploaded_image
*******************************/
$imgName = $_SESSION['imgName'];
if(file_exists("temp/$imgTitle"))
{
rename ("temp/$imgName", "uploaded_image/$imgName") or die ("Could
not copy file");
}
..
how do i ensure that the addQuery or upload of pics do not occur if either one of them has error??