Trying to insert recotd
Hi,
I am trying to insert record from a form like
<?php require_once('webassist/mysqli/rsobj.php'); ?>
...
<body>
<form id="form1" name="form1" method="post">
<input name="username" type="text" id="username" ><p>
</p>
<p>
<input name="submit" type="submit" id="submit" formaction="insert.php" formmethod="POST" value="Submit">
</p>
</form>
</body>
the insert record code
<?php require_once('Connections/adultlch.php'); ?>
<?php require_once('webassist/mysqli/queryobj.php'); ?>
<?php
if ($_SERVER["REQUEST_METHOD"] === "POST") {
$InsertQuery = new WA_MySQLi_Query($adultlch);
$InsertQuery->Action = "insert";
$InsertQuery->Table = "tpat";
$InsertQuery->bindColumn("username", "s", "".((isset($_POST["username"]))?$_POST["username"]:"") ."", "WA_DEFAULT");
$InsertQuery->saveInSession("");
$InsertQuery->execute();
$InsertGoTo = "set_form.php";
if (function_exists("rel2abs")) $InsertGoTo = $InsertGoTo?rel2abs($InsertGoTo,dirname(__FILE__)):"";
$InsertQuery->redirect($InsertGoTo);
}
?>
but it doesn't work with There is an error in your SQL syntax.
https://adultlch.gr/test/set_form.php
thank's