I'm having some serious difficulty trying to get my php sql INSERT to work. I'm trying to display user data but it just echoes, "INSERT INTO customer (cust_last, cust_first) VALUES ('user','data') Done. "
Obviously its something with the sql statement, but it is copied directly from W3Schools' example for PHP INSERT, so I'm unsure why it doesn't work. Am I not supposed to use "" or something?
Thanks for the help!
<?php
$db = odbc_connect('database1', '', '');
$sql="INSERT INTO customer (cust_last, cust_first)
VALUES ('$_POST[cust_last]','$_POST[cust_first]')";
$rs=odbc_num_rows($conn);
odbc_close($conn);
echo "1 record added.";
?>
The HTML form page is:
<html>
<body>
<form action="insert.php" method="post">
Last Name: <input type="text" name="cust_last">
First Name: <input type="text" name="cust_first">
<input type="submit">
</form>
</body>
</html>
customertable.