| ADOdb Library for PHP Manual | ||
|---|---|---|
| Prev | Debugging | Next |
<?php
include('adodb.inc.php'); #
load code common to ADOdb
$conn = &ADONewConnection('access'); #
create a connection
$conn->PConnect('northwind'); #
connect to MS-Access, northwind dsn
$shipto = $conn->qstr("John's
Old Shoppe");
$sql = "insert
into orders (customerID,EmployeeID,OrderDate,ShipName) ";
$sql .= "values
('ANATR',2,".$conn->FormatDate(time()).",$shipto)";
$conn->debug = true;
if ($conn->Execute($sql) === false) print 'error
inserting';
?>
In the above example, we have turned on debugging by setting debug = true. This will display the SQL statement before execution, and also show any error messages. There is no need to call ErrorMsg() in this case. For displaying the recordset, see the rs2html() example.
Also see the section on Custom Error Handlers.
| Prev | Home | Next |
| Inserting | Up | MySQL and Menus |