How to Automatic Delete Row by Period Time (phpMyAdmin)?

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • mrukmana02
    New Member
    • Jun 2019
    • 4

    How to Automatic Delete Row by Period Time (phpMyAdmin)?

    Hello everyone. I need your help to finishing my Diploma Final Project. I have database MySQL in phpMyAdmin. Database name is "logger" and table name is "logger". The table have 2 column, there are: 1. Date & Time (timestamp type) and 2. Information (text type).
    The date in database is receive for arduino every second. So, i want to delete the date after 14 days created in database. How do the solution for my final project problem?
  • Luuk
    Recognized Expert Top Contributor
    • Mar 2012
    • 1043

    #2
    Is it a 1-time-action? Or should all actions be automatically be deleted when they are older than 14 days?

    When it's a one-time action, you should be able to craft a 'DELETE FROM logger WHERE ...' statement in SQL. If you are not able to create that, than you fail exams for your Diploma Final Project.

    If this needs to be done 'automatically', I do mean that everything older than 14 days is deleted, so when you come back tomorrow, or the day after tomorrow, you still do not see records that are older than 14 days. you wil need to read the manual for MySQL for it where it explains the Event Scheduler

    Comment

    • mrukmana02
      New Member
      • Jun 2019
      • 4

      #3
      It's all action automatically be deleted when the date older than 14 days.
      Ok thanks you, Luuk for the solution

      Comment

      • zmbd
        Recognized Expert Moderator Expert
        • Mar 2012
        • 5501

        #4
        mrukmana02
        (...) How do the solution for my final project problem? (...)
        This is a Homework problem.
        How is it fair to yourself, or your fellow classmates, that Luuk provided the solution?

        FAQ: Posting Homework or Coursework Questions and Answers
        Posting Homework or Coursework Questions and Answers
        Any and all Homework/Coursework questions will be deleted. If you see a question that is a homework or coursework assignment then please remember DO NOT attempt to post a reply. Replies to this thread will be deleted along with the original post. Please 'report' the thread.
        \\Thread is closed//

        Comment

        Working...