MySQL Forums
Forum List  »  PHP

PHP MySql Update Where problem
Posted by: James Smith
Date: May 02, 2012 07:41AM

Hi I can't work out why this is not working. It works in a separate table or if I don't do Update Where, just Insert into, so that it works on a new row but does will not update the row I want.

Any help would be very appreicated.

php Code:
function updatePayments($data){
global $link;
if(is_array($data)){
$sql = mysql_query("UPDATE `gigs` SET (txnid, payment_amount, payment_status, itemid, createdtime)
VALUES ('".$data['txn_id']."' , '".$data['payment_amount']."' , '".$data['payment_status']."' , '".$data['item_number']."' , '".date("Y-m-d H:i:s")."')
WHERE`gigname` ='".$data['item_number']."'", $link);
return mysql_insert_id($link);
}
}

Options: ReplyQuote


Subject
Written By
Posted
PHP MySql Update Where problem
May 02, 2012 07:41AM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.