hi...
I am getting an 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 '.1989)' at line 1"
please help me removing the errror
<?php
include "functions.php";
?>
<html>
<head>
<title>
Register Form
</title>
</head>
<body>
<center>
<form method="POST" action="index.php">
<table border="0" style="width:250;text-align:left;border: 1px solid black;padding:2px; font-family:Verdana; font-size:12px; ">
<tr>
<td>
Username:
</td>
<td>
<input type="text" name="username" >
</td>
</tr>
<tr>
<td>
Password:
</td>
<td>
<input type="password" name="password" >
</td>
</tr>
<tr>
<td>
Gender:
</td>
<td>
<select name="gender">
<option value="Male">Male</option>
<option value="Female" >Female</option>
</select>
</td>
</tr>
<tr>
<td>
Birth Year:
</td>
<td>
<select name="birth_year">
<?php
$num=1988;
while($num <= 2008)
{
$num++;
echo "<option value=$num>".$num."</option> ";
}
?>
</select>
</td>
</tr>
<tr>
<td colspan="2" align="center">
<input type="submit" name="submit" value="submit">
</tr>
</table>
</form>
<?php if($_POST['submit']) { ?>
<table border="0" style="color: red;width: 250; margin-top:5px;border: 1px solid black;padding:2px; font-family:Verdana; font-size:12px; ">
<?php
$curnum= 0;
$username= $_POST['username'];
$password= $_POST['password'];
$gender= $_POST['gender'];
$byear= $_POST['birth_year'];
if(!$username)
{
$curnum++;
echo "<tr><td>".$curnum.".Please enter a username</td></tr>";
}
if(!$password)
{
$curnum++;
echo "<tr><td>".$curnum.".Please enter a password</td></tr>";
}
if($username)
{
if(strlen($username) > 20){
$curnum++;
echo "<tr><td>".$curnum.".Your username is tooo long (3-20 characters)</td></tr>";
}
if(strlen($username)< 3){
$curnum++;
echo "<tr><td>".$curnum.".Your username is tooo short (3-20 characters)</td></tr>";
}
}
if($password)
{
if(strlen($password) > 25)
{
$curnum++;
echo "<tr><td>".$curnum.".Your password is tooo long (5-25 characters)</td></tr>";
}
if(strlen($password)< 5)
{
$curnum++;
echo "<tr><td>".$curnum.".Your password is tooo short (5-20 characters)</td></tr>";
}
}
if($curnum == 0)
{
mysql_query("INSERT INTO users VALUES(`id`,'".$username."','".$password."','".$gender."'.".$byear.")") or die(mysql_error());
}
?>
</table>
<?php } ?>
</center>
</body>
</html>