Two easy questions I think..

From: Date: Fri, 13 Feb 2004 10:13:33 +0000
Subject: Two easy questions I think..
Groups: php.general 
Request: Send a blank email to php-general+get-177583@lists.php.net to get a copy of this message
Hi.. 1- In my mySQL DB there is a field named "Whole".. there are many rows.. and every one has the value for the field "Whole". What I want is to add all these values in all rows for the field "Whole" then show it on the screen.. I mean by add : 1 + 2 + 3 = 6... 2- I have another filed there also.. named "UserNo" I want every adding query to this field to include a value in the row for that field = the latest row's value + 1 For example : if there are three rows in the table.. Row1 : "UserNo" value = 1 Row2 : "UserNo" value = 2 Row3 : "UserNo" value = 3 I want PHP to get the last row's value for that field (In this example : 3) then add to it 1.. so it will be 4 and insert it to the new row.. Regards..

« previous php.general (#177583) next »