HELLO experts …………Im in trouble .can you plz help me >>>>>>>Im write a php coding for registration form for my website ………after all………………I get this error (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 ‘1’ at line 1) plz help me ……………..
THIS IS MY CODING
<html>
<body>
<form action=”insertdb.php” method=”post”> <br />
First Name: <input type=”text” name=”firstname” /> <br />
Last Name: <input type=”text” name=”lastname” /> <br />
Age:<input type=”text” name=”age” /> <br />
Country: <input type=”text” name=”contury” /> <br />
City: <input type=”text” name=”city” /> <br />
Contact: <input type=”text” name=”contact” /> <br />
<input type=”submit” />
</form>
</body>
</html>
<?php
$con = mysql_connect(“localhost”,”665995″,”789512357u”);
if (!$con)
{
die(‘Could not connect: ‘ . mysql_error());
}
mysql_select_db(“665995”, $con);
$sql=mysql_query(“INSERT INTO Main(firstname,lastname,age,contury,city,contact)
VALUES
(‘$_POST[firstname]’,’$_POST[age]’,’$_POST[city]’,’$
if (!mysql_query($sql,$con))
{
die(‘Error: ‘ . mysql_error());
}
echo “1 record added”;
mysql_close($con)
?>
plz plz help me
Im wating for your reply