How to automatic update at 12 pm in mysql?

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • izmanhaidi@gmail.com

    How to automatic update at 12 pm in mysql?

    Hi,
    For my final project,I must do cafeteria systems with mysql backend
    database.

    This is my system.

    Student will have $10 and will deduct for breakfast,lunch and dinner.If
    they eat breakfast $2,so the money will become $8.At the end of the
    day,they will have $0.

    Ok,I know how to do that.

    But how come I using mysql that at 12 pm,the student money will back to
    $10.

    Thanks.
    -iZMAN

  • Leif Neland

    #2
    Re: How to automatic update at 12 pm in mysql?

    izmanhaidi@gmai l.com wrote:[color=blue]
    > Hi,
    > For my final project,I must do cafeteria systems with mysql backend
    > database.
    >
    > This is my system.
    >
    > Student will have $10 and will deduct for breakfast,lunch and
    > dinner.If they eat breakfast $2,so the money will become $8.At the
    > end of the day,they will have $0.
    >
    > Ok,I know how to do that.
    >
    > But how come I using mysql that at 12 pm,the student money will back
    > to $10.[/color]

    You could store each buy with a date, and only add the buys for today when
    calculating the amount left.

    Or the dirty way, which has no history of what the students has bougth (sp)
    previously.
    Store the amount left and the date of the purchase.
    Then when you read/update the database, check if the date of the last
    purchase is today, if not, reset the amount left, and set the date to today.

    PS: Don't forget to credit the usenet when you deliver your report...

    Leif



    Comment

    Working...