Code: Select all
<?php
//global variables
$expr1 = $_POST["expr1"];
$msrp = $_POST["msrp"];
$type = $_POST["type"];
$make = $_POST["make"];
$expr2 = $_POST["expr2"];
$msrpA = $_POST["msrpA"];
$FitMK = $_POST["FitMK"];
$name = $_POST["name"];
$address = $_POST["address"];
$city = $_POST["city"];
$state = $_POST["state"];
$zip = $_POST["zip"];
$phone = $_POST["phone"];
$email = $_POST["email"];
$dob = $_POST["dob"];
$ssn = $_POST["ssn"];
$salesman = $_POST["salesman"];
$date = $_POST["date"];
$qexpire = mktime(0, 0, 0, date("m") , date("d")+7, date("Y"));
$tax = $_POST["tax"];
$title = $_POST["title"];
$total = $_POST["total"];
$acclist = $_POST["acclist"];
$quotenum = ($_POST["quotenum"]-1);
$acctax = $_POST["acctax"];
$acctotal = $_POST["acctotal"];
$outthedoor = $_POST["outthedoor"];
// connect to ODBC
$db_connection = new COM("ADODB.Connection");
$db_connstr = "DRIVER={Microsoft Access Driver (*.mdb)}; DBQ=". realpath("fpdb/quote.mdb") ." ;DefaultDir=". realpath("../");
$db_connection->open($db_connstr);
/* run insert */
$stmt = odbc_prepare($db_connstr, "INSERT INTO customer_q (quotenum, date, name, address, city, state, zip, ssn, dob, phone, email, salesman, vehicle1, accessory0)
VALUES('$quotenum', '$date', '$name', '$address, '$city', '$state', '$zip', '$ssn', '$dob', '$phone', '$email', '$salesman', '$vehicle1', '$accessory0');" );
/* check for errors */
if (!odbc_execute( $stmt))
{
/* error */
echo "Whoops<BR>";
}
echo $quotenum
?>
Viewing the source code, I get:
PHP Warning: odbc_prepare(): supplied argument is not a valid ODBC-Link resource in test5.php on line 82
PHP Warning: odbc_execute(): supplied argument is not a valid ODBC result resource in test5.php on line 85
Line 82 is:
Code: Select all
VALUES('$quotenum', '$date', '$name', '$address, '$city', '$state', '$zip', '$ssn', '$dob', '$phone', '$email', '$salesman', '$vehicle1', '$accessory0');" );
Line 85 is: