Results 1 to 4 of 4
  1. #1
    Join Date
    Feb 2004
    Posts
    2

    Unanswered: Repeated Form Areas to Update a Databse

    Hi,

    Hopefully this won’t sound too horrendous as I try and explain.

    I am trying to figure out a way to have a user add multiple basketball fixtures to a website through a content management front end. Adding one fixture at a time in the usual manner works a treat however it is a little slow and means that if multiple fixtures need to go it the user has to click in circles to get back to the add fixture link each time.

    I'd like to present them with a choice of inputting how many fixtures they want to add and then produce a single form that contains the correct number of Home and Away elements for them to fill in. The home and Away teams are presented in Drop Down Boxes and are read from a MySQL database table. Once they have selected all of the fixtures it should then update the relevant table in the database. As I have said I have this working on a one fixture one form basis OK.

    I have tried using a PHP do, while but I was unsure how to get a differentiation between each individual fixture for the home and away form elements so that I could populate the database with a record for each given fixture.

    Can anyone say if this can be done relatively easily or does it involve some serious coding and if it is relatively simple what approach should I use.

    I should qualify that I am not a hugely advanced user and am still learning some of the techniques involved in PHP / MySQL

    Many thanks to anyone who can help out.

  2. #2
    Join Date
    Jan 2004
    Location
    India
    Posts
    168

    Re: Repeated Form Areas to Update a Databse

    I didn't get exactly what your problem is, But I guess you want to update into the database based on multiple selection.
    For this you can use Array and a for loop. The field name[i](drop down) can be represented as the array with the field selected.
    You have to change the drop down to list box first, to this.

    Regards
    Rajesh


    Originally posted by AndyShark
    Hi,

    Hopefully this won’t sound too horrendous as I try and explain.

    I am trying to figure out a way to have a user add multiple basketball fixtures to a website through a content management front end. Adding one fixture at a time in the usual manner works a treat however it is a little slow and means that if multiple fixtures need to go it the user has to click in circles to get back to the add fixture link each time.

    I'd like to present them with a choice of inputting how many fixtures they want to add and then produce a single form that contains the correct number of Home and Away elements for them to fill in. The home and Away teams are presented in Drop Down Boxes and are read from a MySQL database table. Once they have selected all of the fixtures it should then update the relevant table in the database. As I have said I have this working on a one fixture one form basis OK.

    I have tried using a PHP do, while but I was unsure how to get a differentiation between each individual fixture for the home and away form elements so that I could populate the database with a record for each given fixture.

    Can anyone say if this can be done relatively easily or does it involve some serious coding and if it is relatively simple what approach should I use.

    I should qualify that I am not a hugely advanced user and am still learning some of the techniques involved in PHP / MySQL

    Many thanks to anyone who can help out.

  3. #3
    Join Date
    Jan 2004
    Location
    Aberdeen
    Posts
    12
    Hi,

    you need to use variable variables.
    Check out http://uk2.php.net/manual/en/languag...s.variable.php
    for some examples.

  4. #4
    Join Date
    Feb 2004
    Posts
    2
    Many thanks to both of you, Sorry for the delay in posting again - been rushed off my feet with work.

Posting Permissions

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