Hi all,
I am new to this forum... It has been awhile since i have worked with arrays, and i am starting to pull my hair out with this little issue i am having..
I hope someone can help me out with it, or even possibly show me a better way of doing this.
I am creating an web based hockey stats program for a ball hockey league.
I have a score sheet where they enter data. The score sheet gets constructed in a single form with a row for each player on the team. there are 12 players on each team so there will be 24 rows of data in the end.
I need to store each players game stats individually in a stats table where i can keep track of player game stats for each game.
here is the code for my form.
Code: while ($r_hmp = mysql_fetch_array($q_hm_play)) {
echo "<tr>";
echo "<td>".$r_hmp['jnum'] ."</td>";
echo "<td>".$r_hmp['lname'].", ".$r_hmp['fname']." ( ".$r_hmp['position'] ." )<input type='hidden' name='pid[]' value='".$r_hmp['id']."'></td>n";
echo "<td><input type='text' name='gp[]' size='2' maxlength='2'></td>n";
echo "<td><input type='text' name='g[]' size='2' maxlength='2'></td>n";
echo "<td><input type='text' name='a[]' size='2' maxlength='2'></td>n";
echo "<td><input type='text' name='pns[]' size='2' maxlength='2'></td>n";
echo "<td><input type='text' name='pim[]' size='2' maxlength='2'></td>n";
echo "<td><input type='text' name='gw[]' size='2' maxlength='2'></td>n";
echo "<td><input type='text' name='pg[]' size='2' maxlength='2'></td>n";
echo "<td><input type='text' name='sg[]' size='2' maxlength='2'></td>n";
echo "<td><input type='text' name='pa[]' size='2' maxlength='2'></td>n";
echo "<td><input type='text' name='sa[]' size='2' maxlength='2'></td>n";
echo "<td><input type='text' name='soa[]' size='2' maxlength='2'></td>n";
echo "<td><input type='text' name='sog[]' size='2' maxlength='2'></td>n";
echo "<td><input type='text' name='psa[]' size='2' maxlength='2'></td>n";
echo "<td><input type='text' name='psg[]' size='2' maxlength='2'></td>n";
echo "<td><input type='text' name='mj[]' size='2' maxlength='2'></td>n";
echo "<td><input type='text' name='mc[]' size='2' maxlength='2'></td>n";
echo "<td><input type='text' name='gm[]' size='2' maxlength='2'></td>n";
echo "<td><input type='text' name='gr[]' size='2' maxlength='2'></td>n";
echo "<td><input type='text' name='mt[]' size='2' maxlength='2'></td>n";
echo "</tr>n";
$hi++;
one the score keeper clicks the save button i am trying to create a multi-leveld array where i store 24 rows of data
each row should hold the players id and his particular stats for the game.
i tried to setup my array so i could loop troug it using two counters $player[$i][$x] where i would be the count of the row and x being the stat data.
here is the code i have tried, and to no avail.... your help with this would be greatly appreciated. I am sure there is a simple solution to this, but i am stuck and can't seem to find any info that might point me in the right direction.
thanks in advance
Code: $hmpc = count($_POST['pid']);
$i = 0;
while ($i <= $hmpc) {
$player = array($_POST['pid'],array($_post['gp']);
$i++;
}
$i = 0;
$x=0;
echo $hmpc;
while ($i < $hmpc) {
while ($x < $hmpc) {
echo 'Player Data: '.$player[$i][$x];
$x++;
}
$i++;
Disable html within defined tags
I have a mysql database that allows users to enter content with html, but I also want to have a tag that will disable the html between it for example:<a
php sessions,logouts & the bloomin back button!
Hi All,I've got a cms that members can log into. When they logout, the session is destroyed, however, if you click the back button, you can get back into the CMS.How can I get around this?My logout
To change the name of label on SAP screen XK02.
Hi All,
Problems with adding a link to one position in a 'foreach' loop, please help
Hello!Iam pretty new to programming and I wanna create a table with users from an array. It works just fine but in one table row I wanna add a link to it so I can click on the username to edit it
Uploading/Downloading files stored in MySQL database
Hey all,This problem just came up in my website and I'm having a hard time figuring out what's wrong. I have a intranet portal running (custom built) and I'm storing all different types of documents
question about stripslashes and real_escape_string
im cleaning up an old app that I wrote fixing some of the vulernabilities from attacks.I have roughly 30 files. I want to be able to edit every $_POST and $_GETCode:
Warning message
I've put a website that I was doing live and I'm getting this warning message when I try to add a new user when I'm not logged in. It should redirect me back to the login page but I get this
SAP FICO learning materials
Hi all,
PO Release Strategy Issue
Hi Experts,
Connect to database that isn't localhost
I am currently doing a small script for a company that doesn't have mySql support on there hosting. How would I connect to the database on my hosting account? Currently I am using the following but