On Saturday, February 23, 2002, at 02:42 PM, Nick Wilson wrote: > I'd like to add a simple 'thumbs up, thumbs down' vote mechanism to it. > The (simplified) table looks like this: > > id | authId | title | tip > > > The only way I've come up with so far is to add two more fields > (thumbs_up and thumbs_down). Then.... > > each time someone votes... > get the current value of the field (say thumbs_up) > use php to increment it's value and > pop it back in the db.
What if you made the field a signed INT field, and used PHP to subtract one from the current value of the field every time someone chose "thumbs down" or add one to the current value of the field every time someone chose "thumbs up". This way you could have a "level" of how well the author stacks up. This is just another idea shooting the moon, the truth is that it would probably be fine either way. A matter of personal preference. Erik ---- Erik Price Web Developer Temp Media Lab, H.H. Brown [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php