Hi
Would like to rewrite this patch of MySQL update query better can someone please help.
$sqlStatment = "UPDATE products SET "
. "catid=" . $_REQUEST['cat']
. ", cattxt='" . $catText
. "', ptitle='" . $_REQUEST['ptitle']
. "', saleoffer='" . $_REQUEST['saleoffer']
. "', url='" . $_REQUEST['url']
. "', tag=" . $_REQUEST['tag']
. "', oldprice=" . $_REQUEST['oprice']
. ", nprice=" . $_REQUEST['nprice']
. ", availability=" . $_REQUEST['availability']
. ", shortdesc = :shortdescription"
. ", pdescription = :description"
. ", meta_title =" . $_REQUEST['meta_title']
. ", meta_keyword =" . $_REQUEST['meta_keyword']
. "', meta_description=" . $_REQUEST['meta_description']
. ", last_modified = NOW()"
. " WHERE id=" . $_REQUEST['pid'];
try{
$query = $db->prepare($sqlStatment);
$query->execute(array(':shortdescription'=>$_REQUEST['shortdescription'], ':description'=>$_REQUEST['description']));
}
catch(PDOException $e) {
die($e->getMessage());
}
Thank you for any help.