the code im providing below used to work, until i was convinced to do a mod rewrite, I just went to use this part of the script and now it doesnt display what its supposed to.
before the mod rewrite all team, players,seasons, etc had a bunch of zeros then the id that it was was.
so a team id of 8 used to be 0008
if(isset($_POST['submit']))
{
$ptid = $_POST['ptid'];
$seas = $_POST['seas'];
$award = $_POST['award'];
$count = (int)$_POST['count'];
mysql_query("TRUNCATE TABLE `awards`");
for($i = 0; $i <= $count; $i++)
{
if($ptid[$i] != "" && $seas[$i] != "" && $award[$i] != "")
{
if(strlen($ptid[$i]) == 4)
{
mysql_query("INSERT INTO `awards` VALUES('1', '', '" . $ptid[$i] . "', '" . $seas[$i] . "', '" . $award[$i] . "')");
}
else
{
mysql_query("INSERT INTO `awards` VALUES('0', '" . $ptid[$i] . "', '', '" . $seas[$i] . "', '" . $award[$i] . "')");
}
}
}
}
i figured this is the part that determines if it needs to save as a team or a player
if(strlen($ptid[$i]) == 4)
but since no teams are now 4 (0000) in length it saves teams as players and it doesnt show up right.
i have changed the 4 to a 1 and it saves most of the teams correctly, but i have teams with ids more than 1 integer which is giving me the problems now.
is there a way i can make i can add a 2 in there so it will save ids with 1 and 2 as teams