När man lägger till en post i tabell ska samtidigt ett annat fält i en annan tabell uppdateras, men det funkar inte.
<?php
// Open the database
require '../inc/db.php';
// Edit
$update = "UPDATE Participants SET active='1' WHERE id = '$id'";
$update2 = mysql_query($update) or die (mysql_error());
// Close the database
mysql_close();
// Open the database
require '../inc/db.php';
// Update seasons
$update3 = "UPDATE Players SET seasons = seasons+1 WHERE id = '$id'";
$update4 = mysql_query($update3) or die (mysql_error());
// Then redirect
echo "<script language=JavaScript>";
echo "self.location.replace('players-waiting.php')";
echo "</script>";
// Close the database
mysql_close();
?>
<?php
// Open the database
require '../inc/db.php';
// Edit
mysql_query = "UPDATE Participants SET active='1' WHERE id = '$id'";
// Update seasons
mysql_query = "UPDATE Players SET seasons = seasons+1 WHERE id = '$id'";
// Then redirect
echo "<script language=JavaScript>";
echo "self.location.replace('players-waiting.php')";
echo "</script>";
?>
<?php
// Open the database
require '../inc/db.php';
// Edit
mysql_query("UPDATE Participants SET active = '1' WHERE id = '$id'") or die ("<h2>ERROR Query 1</h2>".mysql_error());
// Update seasons
mysql_query("UPDATE Players SET seasons = seasons+1 WHERE id = '$id'") or die ("<h2>ERROR Query 2</h2>".mysql_error());
?>
<script type="text/javascript">
self.location.replace('players-waiting.php');
</script>