Re: [PHP-DB] Need help with updating existing mysql records with something else

2011-11-12 Thread tamouse mailing lists
2011/11/11 Amit Tandon att...@gmail.com: U can update the record with following === $result = mysql_query(UPDATE  tax set mwool40_ totqty = $res, $connection) or die(error updating database); Won't this update every row in the table? I think you'd want: $result =

[PHP-DB] Need help with updating existing mysql records with something else

2011-11-10 Thread Guru™
Hi All, I want to update an existing mysql record with another value after calculating it. Below is the code. ?php $connection = mysql_connect(localhost, root, ) or die(Error connecting to database); mysql_select_db(maha, $connection); $result = mysql_query(SELECT * FROM tax, $connection) or

Re: [PHP-DB] Need help with updating existing mysql records with something else

2011-11-10 Thread Amit Tandon
Dear Guru U can update the record with following === $result = mysql_query(UPDATE tax set mwool40_ totqty = $res, $connection) or die(error updating database); if (mysql_affected_rows($connection) != 1 (/* no of rows that should be updated */) { die(Update problem) ; } The only issue