Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 4 of 4
  1. #1
    New to the CF scene
    Join Date
    Aug 2007
    Posts
    8
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Exclamation How do I write code that keeps a log and updating info? PLEASEEEE HELP

    I have a popup box that allows the user to submit the current amount of miles left on the vehicle after they are finished using that specific vehicle.

    What I want is to be able to keep a log of the total miles and keep the miles updating after every use.

    I have a table called trucks_miles with (4) fields called:
    truck_id
    start_miles
    end_miles
    truck_miles


    How should I start my coding off to get this accomplished?

  • #2
    Supreme Master coder! _Aerospace_Eng_'s Avatar
    Join Date
    Dec 2004
    Location
    In a place far, far away...
    Posts
    19,291
    Thanks
    2
    Thanked 1,043 Times in 1,019 Posts
    What will you be using to store the miles? A database? A flat file? If a database what kind of database?
    ||||If you are getting paid to do a job, don't ask for help on it!||||

  • #3
    New to the CF scene
    Join Date
    Aug 2007
    Posts
    8
    Thanks
    0
    Thanked 0 Times in 0 Posts
    phpmyadmin

  • #4
    Senior Coder
    Join Date
    Jan 2007
    Posts
    1,648
    Thanks
    1
    Thanked 58 Times in 54 Posts
    What will you be using to store the miles? A database? A flat file? If a database what kind of database?
    I have a table called trucks_miles with (4) fields called:
    I think few things other than a database have tables with fields

    You're going to have to insert a new row into your table everytime someone submits the number of miles.

    If they enter the start and end miles, then you can just pass that info into the insert, but if they don't, then you'll need to get the most recent entry from the table, take the end_miles column and add the new miles to it to get your end_miles for the insert.

    You should probably add a date column to your table though, for this method to work. Also, why is there a field called truck_miles?


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •