I have a form:
<table border="1">
<tr>
<td align="center">Form Input Employees Data</td>
</tr>
<tr>
<td>
<table>
<form method="post" action="input.php">
<input type="hidden" name="id" value="1234">
<tr>
<td>Product Name</td>
<td><input type="text" name="name" size="20">
</td>
</tr>
<tr>
<td>Brand</td>
<td><input type="text" name="brand" size="40">
</td>
</tr>
<tr>
<td></td>
<td align="right"><input type="submit" name="submit" value="Sent"></td>
</tr>
</form>
</table>
and my input.php is:
<?
//the example of inserting data with variable from HTML form
//input.php
mysql_connect("localhost","xxx","xxx");//database connection
mysql_select_db("xxxx_xxx");
//inserting data order
$order = "INSERT INTO wp_userdata
(id, product_name, product_brand)
VALUES
('$_POST[id]',
'$_POST[name]',
'$_POST[brand]')";
//declare in the order variable
$result = mysql_query($order); //order executes
if($result){
echo("<br>Input data is succeed");
} else{
echo("<br>Input data is fail");
}
?>
When I click Sent button, new row is added to database table, but only product_name
and product_brand
is recorded. The hidded input "id" value doesn't get into table...
How do I get it to record all 3 values: id
, product_name
and product_brand
?