+ Post New Thread
Results 1 to 4 of 4
Coding Thread, PHP to populate a database with sports fixtures in Coding and Web Development; This is going to be quite specific. I have a lovely flash animation that someone has made for me that ...
  1. #1
    cromertech's Avatar
    Join Date
    Dec 2007
    Location
    Cromer by the coast
    Posts
    731
    Thank Post
    177
    Thanked 109 Times in 97 Posts
    Rep Power
    54

    Question PHP to populate a database with sports fixtures

    This is going to be quite specific. I have a lovely flash animation that someone has made for me that does a sweep through a football line up. It allows me to pass the variables of the players to it via a single url using the pipe character to separate the names.

    I'm looking for a php script that can populate a database with the players for each years football teams in the positions (2 each for years 7,8 and 9 and general u13 u16 etc) and one that will generate the correct url for the flash depending on a variable passed to it (that corresponds to the team needed) via it's url.

    Wow that all sounds a little complicated but I'm hopeful that someone can help me with this

    flash url needs the following

    Code:
    thetitle=Team Name
    thedate=A Date
    theplayers=RightForward|LeftForward|LeftMid|CenLeftMid|...etc then Subs

  2. #2

    Join Date
    May 2008
    Location
    Cheshire
    Posts
    292
    Thank Post
    48
    Thanked 27 Times in 24 Posts
    Rep Power
    18
    Do you still need help on this?
    How much php knowledge do you have?

  3. #3
    Flakes's Avatar
    Join Date
    Nov 2009
    Location
    Newcastle
    Posts
    476
    Thank Post
    38
    Thanked 74 Times in 48 Posts
    Rep Power
    27
    Quote Originally Posted by cromertech View Post
    This is going to be quite specific. I have a lovely flash animation that someone has made for me that does a sweep through a football line up. It allows me to pass the variables of the players to it via a single url using the pipe character to separate the names.

    I'm looking for a php script that can populate a database with the players for each years football teams in the positions (2 each for years 7,8 and 9 and general u13 u16 etc) and one that will generate the correct url for the flash depending on a variable passed to it (that corresponds to the team needed) via it's url.

    Wow that all sounds a little complicated but I'm hopeful that someone can help me with this

    flash url needs the following

    Code:
    thetitle=Team Name
    thedate=A Date
    theplayers=RightForward|LeftForward|LeftMid|CenLeftMid|...etc then Subs
    first off i wouldnt use GET for this but POST, GET (passing variables through URL) has a built in character limit which you will probablyhit when sending a full team of names accross.

    however it looks like your stuckj with GET as thats what the flash animation uses, just do a get for the variables:

    $players = &_GET['names']

    then a explode to seperate the names using the pipe,

    $names = explode("|", $players);

    then insert into the database:

    $sql = "INSERT INTO TABLE VALUES('$names[0]', '$names[1]'...etc)";
    mysql_query($sql);


    EDIT

    again as above how much do you know? you will need to create a table in the database which contains atleast these values:

    ID, yeargroup, position1, poistion2 all the way to position11 and possibly teamname.
    Last edited by Flakes; 28th July 2011 at 12:07 PM.

  4. #4

    Join Date
    Oct 2010
    Location
    Cambridge
    Posts
    11
    Thank Post
    0
    Thanked 1 Time in 1 Post
    Rep Power
    0
    Be careful doing it this way...

    You will need to create a table in the database which contains atleast these values:

    ID, yeargroup, position1, poistion2 all the way to position11 and possibly teamname.

    If you are creating a database table and find yourself creating POS1 POS2 POS3... etc then you are designing it badly in the first place, although some people find it easier. You should really break it down to multiple tables. One table for TEAMS, one for PLAYERS and one for TEAMhasPLAYERS using the Primary Key ID for TEAMS and PLAYERS and a reference to another table with the description of POSITIONS via a primary key.

    It's more complicated but allows you to do more useful SQL queries on the data and if you add a TIMESTAMP field you can keep historical records too.

SHARE:
+ Post New Thread

Similar Threads

  1. Looking for PHP blog script which does not require database
    By ajbritton in forum Web Development
    Replies: 10
    Last Post: 9th December 2010, 07:50 AM
  2. PHP Database connection
    By apeo in forum Coding
    Replies: 3
    Last Post: 16th January 2009, 10:53 AM
  3. Replies: 1
    Last Post: 3rd October 2008, 11:36 AM
  4. Creating a new database in php and mysql
    By StewartKnight in forum Web Development
    Replies: 18
    Last Post: 21st February 2007, 08:53 AM
  5. PHP flat file database script
    By ajbritton in forum Web Development
    Replies: 3
    Last Post: 26th October 2006, 08:51 PM

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Tags for this Thread

Posting Permissions

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