Færdiggjort

552179 php edit / debugging

My script used to save properly until i went with mod rewrite.

When i first went to the page i was trying to add info on it displayed some information, but not all. when i went to the datbase and made it the id's matched them to what they are now i got the info to come up.

the problem i have now is that when i click save not all info save correctly.

here is the peice of code that needs redone.

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] . "')");

}

}

}

}

now you see this line

if(strlen($ptid[$i]) == 4)

the 4 used to indicate the old team id length 0000

now they are 0 or 00

if i change the 4 to a 1 it saves some info correctly, but not teams with ids of 00. so right now a team id of 12 saves as a player instead of a team

so with that problem i am assuming that players with ids of 0 or 00 might save as teams instead of players. right now a player id of say 7 will save as a team not a player and if team id's get into double digits im assuming players with double digits will save as teams as well

the old value for a player id was 000000000000

Evner: Lidt af Hvert, Artikel Omskrivning , Redigering, MySQL, PHP, Hjemmeside Management

Se mere: php save as, edit rewrite, save edit, edit table php, php edit code, php double submit, script php rewrite, value double, double submit, php table double, player info php, insert code mod, php edit, php players info, php count, php script debugging, player edit code, 0000, script code editing, php values page, php submit double, click mod, needs redone, php script table information, edit php table

Om arbejdsgiveren:
( 84 bedømmelser ) Vancouver, Canada

Projekt ID: #2298125

Tildelt til:

webtechnology07

Please check pmb

$40 USD in 0 dage
(17 bedømmelser)
4.9