Re: REPLACE a field of a row ? ( MySQL )
| From: | Matthew Ballard | Date: | Fri, 08 Dec 2000 22:15:24 +0000 |
| Subject: | Re: REPLACE a field of a row ? ( MySQL ) | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-29414@lists.php.net to get a copy of this message | ||
That only takes one command:
Assuming username is a unique field for in the table and the table is called users:
update users set logins_count=logins_count+1 where username = '$username'
assuming $username contains the username of the person.
Matthew
At 01:59 AM 12/8/2000 -0800, you wrote:
I have a members listing in my table database, and I need to increment a partiular field upon submittion of a <form> . How would I replace the field of a row ... example: logins_count And each time they log in, have it increment ($logins++;) and then write it to that particular row/field ?