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 ...
-
7th July 2011, 03:20 PM #1
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
-
-
IDG Tech News
-
28th July 2011, 11:03 AM #2
- Rep Power
- 11
Do you still need help on this?
How much php knowledge do you have?
-
-
28th July 2011, 12:03 PM #3 
Originally Posted by
cromertech
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.
-
-
26th September 2011, 11:11 AM #4
- 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:
Similar Threads
-
By ajbritton in forum Web Development
Replies: 10
Last Post: 9th December 2010, 08:50 AM
-
Replies: 3
Last Post: 16th January 2009, 11:53 AM
-
Replies: 1
Last Post: 3rd October 2008, 11:36 AM
-
By StewartKnight in forum Web Development
Replies: 18
Last Post: 21st February 2007, 09:53 AM
-
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
-
Forum Rules