adding 'vote' mechanism
| From: | Nick Wilson | Date: | Sat, 23 Feb 2002 19:42:19 +0000 |
| Subject: | adding 'vote' mechanism | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-85957@lists.php.net to get a copy of this message | ||
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
Hi all,
I have an SQL table that holds 'tips' and is linked to a table
containing the authors details.
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.
Is there a better way?
- --
- -----------------------------------------------------------
www.explodingnet.com | Projects, Forums and
+ Articles for website owners
- -- Nick Wilson -- | and designers.
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.0.6 (GNU/Linux)
iD8DBQE8d/CbHpvrrTa6L5oRAkiJAJ9jSWhYcfaYkCLwh89oBRgPO4qGAACfVk35
2wYbTAlhyXEEsXEOh/x7u8k=
=N0Cm
-----END PGP SIGNATURE-----