> thx erik... i missed the first one (comment)... still get
> error... Couldn't
> execute statement1 .... third not sure on the odbc_exec..

OK, I must be brain dead this morning. ;)

----- original code -----
// connect to system dsn odbc name login and password or die
$connect = odbc_connect("DB","name","pword") or die (" not connected");

$sql="INSERT INTO basket (Item,Amount,Price)
Values('$id','$amount','$price')";
// prepare SQL statement
//$sql_prepare = odbc_prepare($connect,$sql) or die("Couldn't prepare
query.");
// prepare SQL statement
$sql_result = odbc_prepare($connect,$sql) or die("Couldn't prepare query.");

// execute SQL statement and get results
odbc_execute($sql_result) or die("Couldn't execute statement1.");

odbc_free_result($sql_result);
odbc_close($connect);
----- end original code -----

1.) Kill the first or the second sql_prepare. They're the same thing and are
therefore redundant.

2.) I'm not all that sure if your die() statements mean a whole lot in this
instance. The way I read it, the odbc driver errors will supercede the
die(). Someone correct me if I'm wrong. :)

3.) What's the EXACT syntax of the error(s) you're receieving? Copy and
paste it into the e-mail, along with the variable values being submitted by
the form. To make that easier, toss in:

print("values: '$id','$amount','$price'\r\n<br>\r\n");

at the top of your code. That way it'll be easier for the list members to
tell what's a happenin' over there.

- Erik



-- 
PHP Windows Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]

Reply via email to