Jump to content

Recommended Posts

Posted

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

 

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

  • 3 weeks later...
Posted (edited)
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

 

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.

Edited by Flakes
  • 1 month later...
Posted

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.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now



×
×
  • Create New...