Making multiple entries into mysql database

Discussion in 'MySQL' started by blackburn2413, Sep 2, 2010.

  1. #1
    Hello everyone, here is what I have. I am making a tee time booking system. I have a page to enter a new tee time with a simple form that passes the variables:

    $name - players name
    $players - number of players
    $date - date of tee time
    $time - scheduled time for tee time

    Anyways, that is working just fine and making new record in my mysql database just as I want it. The other thing I need to accomplish is booking bulk amounts of tee times for outings that the course may book. In this case, what I need is the same name, date, and number of players, but I need these records to be associated with multiple times.

    Here is an example of what I have now for a row in my mysql database:

    John Smith, 08-12-2011, 7:00am, 4 (players)

    I need a way to make multiple entries for an outing so I would get multiple rows in the db and a result like this:

    Smith Outing, 08-12-2011, 7:00am, 4 (players)
    Smith Outing, 08-12-2011, 7:08am, 4 (players)
    Smith Outing, 08-12-2011, 7:16am, 4 (players)
    Smith Outing, 08-12-2011, 7:24am, 4 (players)
    Smith Outing, 08-12-2011, 7:32am, 4 (players)

    I dont want it to come off that I am begging for someone to code this for me. If anyone has any suggestions of how I can structure this, I can do the research and code it all. Mostly just looking for someone to point me in the best direction on how I can accomplish this.


    Thanks everyone!
     
    blackburn2413, Sep 2, 2010 IP
  2. igorov

    igorov Guest

    Messages:
    35
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #2
    Hello;
    For bulk entries, I use a website, whose address I can PM you. If you have your table ready in excell, then it is just a matter of seconds; you just copy the cells and paste them onto the web page, then ask it to turn it into a mysql command (inser into). Then you copy the command and run it on phpmyadmin. Is this what you need?
     
    igorov, Sep 3, 2010 IP
  3. blackburn2413

    blackburn2413 Member

    Messages:
    45
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    41
    #3
    Sure, pm that site over it may help. But the data I am using is coming from a form on a web page. It wont be in a table already as you mentioned.
     
    blackburn2413, Sep 3, 2010 IP
  4. meno

    meno Active Member

    Messages:
    121
    Likes Received:
    2
    Best Answers:
    0
    Trophy Points:
    60
    #4
    use this

    $n = total data

    for($i=0; $1<$n; $i++) {

    $query = insert......

    }
     
    meno, Sep 11, 2010 IP
  5. blackburn2413

    blackburn2413 Member

    Messages:
    45
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    41
    #5
    Got this figured out using checkboxes for the tee time slots I wanted selected, then using the post function I was able to accomplish this. Thanks for the help :D
     
    blackburn2413, Sep 11, 2010 IP