Click here to Skip to main content
15,891,943 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
I have the MySQL table "Messages" which stores the User's Name, Message and ID and I also have a table "Users" which stores there Id, Ip, User agent and Points as well as Password! I was trying to make it so each time a user posts a message in my chat they would gain 1 point, but I didn't know how to do this and google wasn't very helpful! My PHP version is 5.3 if that's any help!
Posted
Updated 17-May-14 11:56am
v3

1 solution

You should redesign your table to
users table has id, username
messages table has id, ip, useragent, message, point.
each time a user post a message, update its record in the messages table with new message and point + 1, like this in pseudo sql:
update messages set message="new message", point=point+1 where id="1234"
 
Share this answer
 
v2

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900