Array and image help

Hello, I hope you guys can help me out (at least point me in the write direction) - I am very green and am trying to work my way thru this as best I can - I am not a programmer, But am trying to learn a few things to make this task easier

I run an fantasy soccer site - And right now all the stats are stored in excel files (manually updated) and then exported to csv files - I have a php file that turns them into a table and shows the results…

http://tonyarmer.net/WSL/LIGA/Valencia.php (as you see it outputs the page with the csv information. Now this is all fine (but a lot of work) as every week the numbers change and they have to be added in the excel file and updated and re-exported - My question is in 2 parts…

First part - The rows that show up in the link above are constant and unchanging - the numbers in those rows will update and change all the time, as a game is played the associated numbers will have to be added to to update the player statistics.

I have thought about putting all this in mySQL and updating it that way and trying to pull from the database - I see what I could use as the tables (from what is listed in the csv file) but not sure the direction to take there (any thoughts)

Second Part (I have posted the code below) - This is a very poorly written piece of code but it does work - What I am trying to figure out is, How can I re-write (or add) to the code to make the player name as a clickable link that will take you to another page that shows more detail, City of birth, height, weight and I would move the stats to this page as well - Now I know doing this in mySQL would help (If I had any idea of what to do, which would include adding the weekly stats together to get totals)… But how could this be handled in just php with a csv file - ANY HELP would be greatly appreciated

[code]

'; echo '';

// put exploded first line in as

’;
}

// end first table row
echo ‘

’;
$win = 0;

// run through remaining lines
for ($i = 1; $i <= sizeof($lines)-1; $i++) {

// explode line
$data = explode(",", $lines[$i]);

// start new row
echo ‘

’;
// put exploded data in as ’;
else
echo ‘’;
}

// end row
echo ‘

’;
$win == 1 ? $win = 0 : $win = 1;
}

// close table tag
echo ‘

element
for ($j = 0; $j <= $columns; $j++) {
$data[$j] = str_replace(’"’,’’,$data[$j]);
echo ‘
’ . $data[$j] . ‘
element
for ($j = 0; $j <= $columns; $j++) {
$data[$j] = str_replace(’"’,’’,$data[$j]);
if ($j == 0)
echo ‘
' . $data[$j] . '’ . $data[$j] . ‘
’;

?>


CUPS

Champions Cup x0 WSL Cup x0 Liga Cup x0
[/code]

How to you receive your stats before putting them together manually?

If you are not wanting to use a database, you could have it load each csv file contents store the variables and then add the next one until it’s out of csv files. Not very efficient though. Slip streaming it by saving the current process in 1 file instead?
So, week 1, loads 1 csv file, save it as total.
Week 2, loads latest and the pre-saved file, save it over old total.
Rinse repeat. Will load 2 per load. Also making it even more slip stream, have that process above as an admin function and have users only load the latest total.

Easiest way is to use database, specially for the players personal data

Sponsor our Newsletter | Privacy Policy | Terms of Service