sql_query
Posted: Mon Jan 17, 2005 10:39 am
ok i have a script that i built that, works on windows but not linux
in the file index.php i have
then in the file update.php
Basically what the script does is in index.php it gets some stats and stores them as a veriable, and it has a bunch of hidden text boxes. Once the form is submited, it sends the information to update.php which receives all of the data and is suppose to update the database. But when i try tp update it gives me an error
And the interesting thing is that it works on windows and not linux.....
in the file index.php i have
Code: Select all
echo"<form method='POST' action='update.php'>";
echo"<b>Update Stats: for $player</b><br>";
echo"<input type='hidden' name='player' size='30' value='$player'>";
echo"<input type='hidden' name='person' size='30' value='$person'>";
echo"<input type='hidden' name='base_targets_destroyed' size='30' value='$base_targets_destroyed'>";
echo"<input type='hidden' name='op' value='savegame'><input type='submit' value='Update' name='B1'></form>";Code: Select all
$player = $_POSTї'player'];
$person = $_POSTї'person'];
$base_targets_destroyed = $_POSTї'base_targets_destroyed'];
$db = mysql_connect("localhost", "", "");
mysql_select_db("top50",$db);
$sql = mysql_query("UPDATE toplevels SET player='$player', person='$person', base_targets_destroyed='$base_targets_destroyed'") or die("Error: ".mysql_error());
echo"<center><b><i>Stats Updated...</i></b></center><br>";but to my knowledge i am not suppose to receive this error becuse i am UPDATING the database which replaces the old key with the new one.Error: Duplicate entry '$player' for key 1
And the interesting thing is that it works on windows and not linux.....