PHP General :: simple counter

This thread was displayed: 0 times


Starting with 17th May 2007, Adobe Systems will stop offering support for any version of the discontinued InterAKT products. As a result, we will not answer to new support incidents starting with May 17th, 2007. Pending support incidents will still be followed in order to be closed. The product forums will remain open and be transformed in user-to-user forums. The general forums will be made read-only and not allow new posts or comments.

For more information about the affected products visit: www.interaktonline.com/Support/

View Threaded Show descending
Tyler Bradshaw
04-09-2007 02:48:46 GMT +2

hey okay this seems like a simple thing to do but i have no idea how to do it.

so my site is run off mysql/php.  basically i want it so for each post, users can say it's "good" or "bad".  but instead of having a separate table for the votes, i want it to simply add to a column in the post table for 'good' or 'bad'.

i think i shoudl have 2 forms set up for each post, so if you click of "good", a hidden field does an update transaction for the post, and a php command grabs the current number of "good" votes and adds 1 to it, and then saves that.  bhut i dont know how to do the php coding for this.


how do i do this?

Back | Reply | Quote | Top
Razvan Racasanu[InterAKT]Adobe Systems Romania staff
04-12-2007 16:14:11 GMT +2

Hello,

You cold do this with 2 submit buttons that have different named for the Good and Bad buttons. Then you can have 2 different update transactions each one triggered by one of the buttons.

Regards,
Razvan RACASANU

Reply | Quote | Top
Tyler Bradshaw
04-12-2007 20:06:09 GMT +2

yes exactly, that's as far as i got though - i dont know how to do the php coding that will grab the current number of "goods" and "bads" and add 1 to that.  i know how to do the transactions, but can you walk me through the php code?

Reply | Quote | Top
Razvan Racasanu[InterAKT]Adobe Systems Romania staff
04-13-2007 09:46:10 GMT +2

Hello,

I'm sorry, but since this is custom code, I'm afraid that we cannot help you implement this as we do not offer commercial support anymore and are low on resources. However, you could follow the suggestion in this thread and use 2 separate fields instead of the count_art that is presented there.

Regards,
Razvan RACASANU

Reply | Quote | Top
Sign In
Sign In to see your information.
© Adobe Systems Romania. All rights reserved.