When I run the code below, I get the next autonumber in the DB, but there is no data in there. I've rechecked all my variables and I can't see anything wrong. It just writes blanks and then autonumbers. What am I missing?
Here is my HTML Form:
Code:
<html>
<head><title></title></head>
<body>
<FORM action="insertintodb.php" method="post">
Requester: <input type="text" name="requester"></br>
Owner:<input type="text" name="owner"></br>
Make/Model:<input type="text" name="makemodel"></br>
Serial Number:<input type="text" name="serialno"></br>
Received:<input type="text" name="received"></br>
Shipped:<input type="text" name="shipped"></br>
Ticket Number:<input type="text" name="ticketno"></br>
Notes/Commnets:<input type="text" name="notes"></br>
<input type="Submit" name="Enter"><input type="reset"></br>
</FORM>
</body>
</html>
and here is the PHP:
PHP Code:
<?php
$requester=$_Post['requester'];
$owner=$_Post['owner'];
$makemodel=$_Post['makemodel'];
$serialno=$_Post['serialno'];
$received=$_Post['received'];
$shipped=$_Post['shipped'];
$ticketno=$_Post['ticketno'];
$notes=$_Post['notes'];
if ( !( $database = odbc_connect( "Warranty", "","")))
die( "Could not connect to database" );
$stmt = odbc_prepare($database, "INSERT INTO WarrantyInformation (Requester, Owner, MakeModel, SerialNo, Received, Shipped, TicketNo, Notes) VALUES('$requester','$owner', '$makemodel', '$serialno', '$received', '$shipped', '$ticketno', '$notes');" );
if (!odbc_execute( $stmt))
{
echo "Whoops";
}
?>
Bookmarks