hello guys.

Just want a little guide here.. because there's no error in program but the data is not inserting to database.

Thank you and god speed!.

<?php

$conn=odbc_connect ('visitor_list','','') or die ("Error cant connect to database");
$sql = "select * from TEMP_LIST";
$rs = odbc_exec($conn,$sql);

if (!$rs)
{
    exit("Error in sql");
}
$emp_no = $_POST['emp_no']; 
$family_name= $_POST['family_name']; 

$query_insert = "insert into TEMP_LIST (emp_no, family_name) Values ('$emp_no','$family_name')";


if ($query_insert)
{

}



?>

<html>
<head>
<title>User Login</title>
<link rel="stylesheet" type="text/css" href="styles.css" />
</head>
<body>
<br>
<form method="POST" action="visitor_register.php">
<table border="0" cellpadding="10" cellspacing="1" width="500" align="center">
<tr class="tableheader">
<td align="center" colspan="2">Guest Reservation Registration</td>
</tr>
<tr class="tablerow">
<td align="right">Employee Number</td>
<td><input type="number_format" name="emp_no" required = "required"></td>
</tr>
<tr class="tablerow">
<td align="right">Family Name</td>
<td><input type="text" name="family_name" required = "required"></td>
</tr>
<tr class="tableheader">
<td align="center" colspan="2"><input type="submit" name="submit" value="Register" 
 align="center" colspan="2"/> &nbsp; &nbsp; &nbsp;
 <input type="button" name="back" value="Back"></td>
</tr>
</table>
</form>
</body>
</html>
Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.