MySQL Forums
Forum List  »  PHP

Re: MySQL Equations
Posted by: Nick Roper
Date: August 01, 2005 03:15PM

Hi David,

Assuming that you have the number of points stored in a variable (say $points) and cust_id is a unique index on the customers table then it would be something like :


<?php

# other code here

.....

# points stored in $points

$sql = "UPDATE customers SET cust_points = cust_points + $points WHERE cust_id = '$cust_id' ";

$result = mysql_query($sql) or die (mysql_error()) ;

......

?>

--
Nick Roper

Options: ReplyQuote


Subject
Written By
Posted
July 29, 2005 10:35AM
Re: MySQL Equations
August 01, 2005 03:15PM


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.