Nieuw lid |
|
Ik heb een systeem gemaakt waar members zich kunne aanmelde voor een clanwar, maar het werkt niet helemaal ik krijg altijd deze error: You have an error in your SQL syntax. Check the manual that corresponds to your MySQL server version for the right syntax to use near 'WHERE `tegenstander` = '$record->tegenstander'' at line 2
hier is de code van het formulier:
<form name="participate" action="a_addparticipation.php" method="post">
<input type="hidden" name="tegenstander" value="$record->tegenstander">
Name:<br>
<input type="text" size="25" name="speler" value="#Fearlezz|Nickname" style="font-family: Verdana, Arial, Helvetica, sans-serif; font-size: 10px; color: #333333; background-color: #EEEEEE; border: 1px solid #333333;"><br><br>
Status:<br>
<input type="radio" name="status" value="I'm sure I can participate">I'm sure I can participate<br>
<input type="radio" name="status" value="I will substitute">I will substitute<br><br>
<input type="submit" name="submit" value="Update my status" style="font-family: Verdana, Arial, Helvetica, sans-serif; font-size: 10px; color: #333333; background-color: #EEEEEE; border: 1px solid #333333;">
<form name="participate" action="a_addparticipation.php" method="post"> <input type="hidden" name="tegenstander" value="$record->tegenstander"> Name:<br> <input type="text" size="25" name="speler" value="#Fearlezz|Nickname" style="font-family: Verdana, Arial, Helvetica, sans-serif; font-size: 10px; color: #333333; background-color: #EEEEEE; border: 1px solid #333333;"><br><br> Status:<br> <input type="radio" name="status" value="I'm sure I can participate">I'm sure I can participate<br> <input type="radio" name="status" value="I will substitute">I will substitute<br><br> <input type="submit" name="submit" value="Update my status" style="font-family: Verdana, Arial, Helvetica, sans-serif; font-size: 10px; color: #333333; background-color: #EEEEEE; border: 1px solid #333333;">
hier de a_addparticipation.php:
<?php
include"functions.php";
if($_POST['submit'])
{ // toon een specifieke war
$tegenstander = $_POST['tegenstander'];
$naam = $_POST['speler'];
if ($_POST['status']=="I'm sure I can participate") {
$_POST['status']=="ja";
db_connect();
$query = "INSERT INTO `upcoming` WHERE `tegenstander` = '".$tegenstander."' (spelers)
VALUES ('$naam') "; //Query aamaken
$sql = mysql_query($query) or die(mysql_error()); // Query uitvoeren
echo"Your status has been updated!";
} else {
$_POST['status']=="misschien";
$query = "INSERT INTO `upcoming` (invallers)
VALUES ('$naam') WHERE `tegenstander` = '".$tegenstander."'"; //Query aamaken
$sql = mysql_query($query) or die(mysql_error()); // Query uitvoeren
echo"Your status has been updated!";
}
}
else
{ echo"First select a status!"; }
?>
<?php include"functions.php"; if($_POST['submit']) { // toon een specifieke war $tegenstander = $_POST['tegenstander']; $naam = $_POST['speler']; if ($_POST['status']=="I'm sure I can participate") { $_POST['status']=="ja"; db_connect(); $query = "INSERT INTO `upcoming` WHERE `tegenstander` = '".$tegenstander."' (spelers) VALUES ('$naam') "; //Query aamaken echo"Your status has been updated!"; } else { $_POST['status']=="misschien"; $query = "INSERT INTO `upcoming` (invallers) VALUES ('$naam') WHERE `tegenstander` = '".$tegenstander."'"; //Query aamaken echo"Your status has been updated!"; } } else { echo"First select a status!"; } ?>
thanx
|