It appears you have not yet registered with DEVPPL. To register please click here... (it's fast, easy and free!)

Forum

Log In Sponsors
Board index Programming PHP and MySQL Forum

rating system update - overlaps

Moderator: Malcolm

rating system update - overlaps

Postby kdjuiopo on Tue Jul 19, 2011 9:43 am

I might be a newb for asking this or i'm just overthinking

i have a rating system wheere when someboy rates it grabs the number from the db, do the math and then update the number in the row

if two people happen to click rate at the same time.. wouldn't that cause problems or chances of that happen is like winning the lottary
kdjuiopo
50+ Club
 
Posts: 90
Joined: Fri Jul 01, 2011 1:32 am

Re: rating system update - overlaps

Postby rajmv on Sun Jul 24, 2011 3:48 pm

Depends on how many hits that button gets..
If it's more than 1 time every 2 seconds, then your risk of missed counts increases.

The "right" way to solve this is with a "sql transaction".
rajmv
100+ Club
 
Posts: 103
Joined: Thu Jul 14, 2011 7:22 am


Who is online

Users browsing this forum: No registered users and 1 guest