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

Discussion in 'Graphics & Webdesign' started by bakul, Oct 20, 2012.

  1. bakul

    bakul New Member

    Messages:
    12
    Likes Received:
    0
    Trophy 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
    [TABLE="class: cms_table_data"]
    [TR]
    [/TR]
    [TR="class: cms_table_odd"]
    [TD="align: center"][/TD]
    [TD="align: right"] 1[/TD]
    [TH]user name[/TH]
    [TD]varchar(15)[/TD]
    [TD]latin1_swedish_ci[/TD]
    [TD="class: cms_table_column_attribute"][/TD]
    [TD]No[/TD]
    [TD]None[/TD]
    [TD][/TD]
    [TD="class: cms_table_edit, align: center"] [​IMG] Change[/TD]
    [TD="class: cms_table_drop, align: center"] [​IMG] Drop[/TD]
    [TD="class: cms_table_more_opts"] [​IMG] More[/TD]
    [/TR]
    [TR="class: cms_table_even"]
    [TD="align: center"][/TD]
    [TD="align: right"] 2[/TD]
    [TH]full name[/TH]
    [TD]varchar(15)[/TD]
    [TD]latin1_swedish_ci[/TD]
    [TD="class: cms_table_column_attribute"][/TD]
    [TD]No[/TD]
    [TD]None[/TD]
    [TD][/TD]
    [TD="class: cms_table_edit, align: center"] [​IMG] Change[/TD]
    [TD="class: cms_table_drop, align: center"] [​IMG] Drop[/TD]
    [TD="class: cms_table_more_opts"] [​IMG] More[/TD]
    [/TR]
    [TR="class: cms_table_odd"]
    [TD="align: center"][/TD]
    [TD="align: right"] 3[/TD]
    [TH]e-mail[/TH]
    [TD]varchar(25)[/TD]
    [TD]latin1_swedish_ci[/TD]
    [TD="class: cms_table_column_attribute"][/TD]
    [TD]No[/TD]
    [TD]None[/TD]
    [TD][/TD]
    [TD="class: cms_table_edit, align: center"] [​IMG] Change[/TD]
    [TD="class: cms_table_drop, align: center"] [​IMG] Drop[/TD]
    [TD="class: cms_table_more_opts"] [​IMG] More[/TD]
    [/TR]
    [TR="class: cms_table_even cms_table_marked"]
    [TD="align: center"][/TD]
    [TD="align: right"] 4[/TD]
    [TH]password[/TH]
    [TD]varchar(15)[/TD]
    [TD]latin1_swedish_ci[/TD]
    [TD="class: cms_table_column_attribute"][/TD]
    [TD]No[/TD]
    [TD]None[/TD]
    [TD][/TD]
    [TD="class: cms_table_edit, align: center"] [​IMG] Change[/TD]
    [TD="class: cms_table_drop, align: center"] [​IMG] Drop[/TD]
    [TD="class: cms_table_more_opts"]more

    [/TD]
    [/TR]
    [/TABLE]

    Please Help me to solution
     

Share This Page