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 2 of 2
  1. #1
    Regular Coder
    Join Date
    Jul 2005
    Location
    Oxfordshire, UK
    Posts
    144
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Create a table in phpmyadmin

    i want to be able to create a table in my db using a php page where i can enter the start time and the end time and enter the interval and then click submit and it will generate the cols in the table for each... for example.

    i enter

    start time: 9.00
    End time: 18.00
    Interval: 10mins.

    i want then the cols in the db to be 9.00, 9.10, 9.20...... etc etc...

    any pointers on how to do this the best way?

    Thanks.

  • #2
    Regular Coder devinemke's Avatar
    Join Date
    Dec 2004
    Location
    NYC
    Posts
    443
    Thanks
    0
    Thanked 12 Times in 11 Posts
    PHP Code:
    $start '9:00 am';
    $end '12:00 pm';
    $interval 10;

    $start_ts strtotime($start);
    $end_ts strtotime($end);

    while (
    $start_ts <= $end_ts)
    {
        echo 
    date('H:i:s'$start_ts) . '<br>';
        
    $start_ts += $interval 60;    



  •  

    Posting Permissions

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