ok so simply put, this is what i have for my form
<form name="myWebForm" action="testorder" method="post">
First: <input title="Please Enter Your First Name" id="first" name="first" type="text" size="12" maxlength="12" /> Last: <input title="Please Enter Your Last Name" id="last" name="last" type="text" size="18" maxlength="24" /><br />
<input type="hidden" name="orderNumber" id="orderNumber" value="<?php echo $orderNumber; ?>" /><br />
<input type="submit" value="SUBMIT" />
<input type="reset" value="RESET" />
</form>
this is my php code:
// Connect to server and select database.
mysql_connect("$host", "$username", "$password")or die("cannot connect");
mysql_select_db("$db_name")or die("cannot select DB");
// get data that sent from form
$orderNumber=$_POST['orderNumber'];
$first=$_POST['first'];
$last=$_POST['last'];
$sql="INSERT INTO $tbl_name(orderNumber, first, last) VALUES('$orderNumber', '$first', '$last')";
$result=mysql_query($sql);
if($result){
echo "Successful<BR>";
echo $orderNumber;
echo $first;
}
else {
echo "ERROR";
}
mysql_close();
?>
now, $first is outputting everything correctly. but the orderNumber is giving me no results.
this is my code for the table:
CREATE TABLEtestform` (
orderNumber int(6) NOT NULL auto_increment,
first varchar(65) NOT NULL default '',
last varchar(65) NOT NULL default '',
KEY orderNumber (orderNumber)
) TYPE=MyISAM;`
Any help would be greatly appreciated. I need to find out a way to spit out the orderNumber