#1064 - You have an error in your SQL syntax; check the manual that corresponds to yo

bakul

New Member
Messages
12
Reaction score
0
Points
0
My php process file is


<?php
if (isset($_POST['submit'])) {
$userName = $_POST["username"];
$fullName = $_POST["fullname"];
$email = $_POST["email"];
$password = $_POST["password"];
$con = mysql_connect("localhost", "root", "");
if (!$con) {
die('could not connect:' . mysql_error());
}
mysql_select_db("alhera", $con);

mysql_query("INSERT INTO form('user name', 'full name', 'e-mail', 'password') VALUES('$userName','$fullName','$email','$password ')");
echo "Your record successfully added";
mysql_select_db("alhera", $con);

$result=mysql_query("SELECT*FROM form");

echo"<table border='1'>
<tr>
<th>user name</th>
<th>full name</th>
</tr>";

while($row=mysql_fetch_array($result))
{
echo"<tr>";
echo"<td>" .$row['user name']. "</td>";
echo"<td>" .$row['full name']. "</td>";
echo"</tr>";
}
echo"</table>";

mysql_close($con);
}
?>



And

Local host table is
1user namevarchar(15)latin1_swedish_ciNoNone Change Drop
dot.gif
More
2full namevarchar(15)latin1_swedish_ciNoNone Change Drop
dot.gif
More
3e-mailvarchar(25)latin1_swedish_ciNoNone Change Drop
dot.gif
More
4passwordvarchar(15)latin1_swedish_ciNoNone Change Dropmore


Please Help me to solution
 
Top