• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

data persistence -- help with some logic

 
Ranch Hand
Posts: 128
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi, i attached a picture of my table.

You'll notice, that on insert or update, a row can have a datetime value or not.

A player (player_id) earns $1 per second, so long as that row contains a datetime value.

If a row that once contained a datetime vaule is updated, or if that row is deleted, so that it no longer contains a datetime value, how do i ensure that the players total earning are not lost.

further more, a player may insert a new row at any time that could add more $ per second to the total earnings.

I know i need a second table for the total earnings, but how should i go about regularly updating the total earnings.

I'd appreciate any thoughts.
Filename: bd_pic.bmp
Description: my table
File size: 629 Kbytes
 
reply
    Bookmark Topic Watch Topic
  • New Topic