ADOdb

Database Abstraction Layer for PHP

User Tools

Site Tools


v5:userguide:userguide_index

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
v5:userguide:userguide_index [2016/03/19 04:00] – [$ADODB_FORCE_TYPE] mnewnhamv5:userguide:userguide_index [2020/01/13 15:50] (current) – Remove NOTOC dregad
Line 1: Line 1:
-<WRAP todo> 
-This page is under reconstruction 
-</WRAP> 
 <WRAP right box> <WRAP right box>
 [[v5:userguide:index|User Guide Index]]\\ [[v5:userguide:index|User Guide Index]]\\
 </WRAP> </WRAP>
-~~NOTOC~~ 
 ====== User Guide ======  ====== User Guide ====== 
 ===== List Of Tutorials ===== ===== List Of Tutorials =====
 ==== Basic Tasks ==== ==== Basic Tasks ====
-|[[v5:userguide:learn_abstraction:introduction|Database Abstraction]]|Using basic ADOdb commands to read data from and write back to the database| +<WRAP> 
-|[[v5:userguide:learn_dictionary:introduction|Data Dictionary Basics]]|How to obtain information about database fields, columns and tables +<wrap left 180px>[[v5:userguide:learn_abstraction:introduction|Database Abstraction]]</wrap> 
-|[[v5:userguide:learn_fields:introduction|Keys,Fields & Field Objects]]|Understanding how to work with the most detailed level of data provided by ADOdb|+<wrap left 450px>Using basic ADOdb commands to read data from and write back to the database</wrap> 
 +</WRAP> 
 +-------------------------- 
 +<WRAP> 
 +<wrap left 180px>[[v5:userguide:learn_dictionary:introduction|Data Dictionary Basics]]</wrap> 
 +<wrap left 450px>How to obtain information about database fields, columns and tables</wrap> 
 +</WRAP> 
 +---------------------------- 
 +<WRAP> 
 +<wrap left 180px>[[v5:userguide:learn_fields:introduction|Keys,Fields & Field Objects]]</wrap> 
 +<wrap left 450px>Understanding how to work with the most detailed level of data provided by ADOdb</wrap> 
 +</WRAP> 
 +-------------------------------
 ==== Advanced Tasks ==== ==== Advanced Tasks ====
-[[v5:userguide:transactions|Transactions]]                                 | Understanding Transaction scope, and how to start, stop and roll back transactions     | +<WRAP> 
-[[v5:userguide:learn_multidatabase:connections|Multi Database Connections]]            | Controlling connections and transactional scoping in multiple databases simultaneously  | +<wrap left 180px>[[v5:userguide:transactions|Transactions]]</wrap> 
-| [[v5:userguide:learn_extensions:new_driver|Creating & Extending Drivers]]  | Adding new functionality and changing the behaviour of existing drivers                | +<wrap left 450px>Understanding Transaction scope, and how to start, stop and roll back transactions </wrap> 
-===== Additional Documentation ===== +</WRAP> 
- +---------------------------- 
-[[v5:reference:reference_index|Reference Guide]]\\ +<WRAP> 
-[[project:include_file_guide|Include File Guide]]\\ +<wrap left 180px>[[v5:userguide:learn_bind:bind_vars|Parameter Binding]]</wrap> 
-[[v5:userguide:portable_sql|Writing Portable SQL]]\\ +<wrap left 450px>Understanding variable binding, portability and bulk insertions</wrap> 
-[[v5:userguide:mysql_tutorial|Migrating MySQL applications to ADOdb]]\\ +</WRAP> 
-[[v5:userguide:error_handling|Customizing Error Handling]]\\ +---------------------------- 
-[[v5:userguide:stored_procedure|Stored Procedure Example]]\\ +<WRAP> 
-[[v5:userguide:deprecated|Deprecated Functionality]]\\ +<wrap left 180px>[[v5:userguide:learn_multidatabase:connections|Multi Database Connections]]</wrap> 
- +<wrap left 450px>Controlling connections and transaction scoping in multiple databases simultaneously</wrap> 
- +</WRAP
- +---------------------------- 
-===== Example 3: Inserting ===== +<WRAP
- +<wrap left 180px>[[v5:userguide:learn_caching:introduction|Result Set Caching]]</wrap
-Insert a row to the Orders table containing dates and strings that need to be quoted before they can be accepted by the database, eg: the single-quote in the word John's. +<wrap left 450px>Caching queries to speed up re-usevia Disk or Memcached caching</wrap> 
- +</WRAP
-<code php+--------------------------- 
-include('adodb.inc.php');    # load code common to ADOdb +<WRAP
-$conn = adoONewConnection('access');        # create a connection +<wrap left 180px>[[v5:userguide:learn_extensions:new_driver|Creating & Extending Drivers]]</wrap> 
-$conn->pConnect('northwind');   # connect to MS-Access, northwind dsn +<wrap left 450px>Adding new functionality and changing the behaviour of existing drivers</wrap> 
- +</WRAP> 
-/* +--------------------------
-* Inserting a string containing quote characters  +
-* may cause a statement to fail if not pre-processed +
-*/ +
-$shipto = $conn->qstr("John's Old Shoppe"); +
-$orderDate = $conn->dbDate(time()); +
- +
-$sql = "insert into orders (customerID,EmployeeID,OrderDate,ShipName) "; +
-$sql .= "values ('ANATR',2,".$orderDate.",$shipto)"; +
- +
-if ($conn->Execute($sql) === false) +
-    print 'error inserting: '.$conn->errorMsg().'<BR>'; +
- +
-</code> +
- +
-In this example, we see the advanced date and quote handling facilities of ADOdb. The unix timestamp (which is a long integer) is appropriately formatted for Access with [[v5:reference:connection:dbdate|dBDate()]]. Note that the date field should not be quoted. If required by the database, the field will be automatically quoted. +
- +
-The correct escape character is used for quoting the John's Old Shoppe, which is John``s Old Shoppe and not PHP's default John's Old Shoppe by using [[v5:reference:connection:qstr|qStr()]]. +
- +
-Observe the error-handling of the Execute statement. False is returned by Execute() if an error occurred. The error message for the last error that occurred is displayed in [[v5:reference:connection:errormsg|errorMsg()]]. Note: php_track_errors might have to be enabled for error messages to be saved. +
- +
-===== Example 4: Debugging ===== +
- +
-<code php+
-include 'adodb.inc.php';    # load code common to ADOdb +
-$conn = adoNewConnection('access');# create a connection +
- +
-$conn->PConnect('northwind');   # connect to MS-Accessnorthwind dsn +
-$shipto = $conn->qstr("John's Old Shoppe"); +
- +
-$sql = "insert into orders (customerID,EmployeeID,OrderDate,ShipName)  +
-                    values ('ANATR',2,".$conn->FormatDate(time()).",$shipto)"; +
- +
-$conn->debug = true; +
- +
-if ($conn->Execute($sql) === false) print 'error inserting'; +
-</code+
- +
- +
-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. +
- +
-For more detailed information on error handling, see the section on [[v5:userguide:debug|debugging]] +
- +
- +
- +
- +
  
  
 +===== Additional Documentation =====
  
 +<WRAP>
 +<wrap left 180px>[[v5:database:connection_matrix]]</wrap>
 +<wrap left 450px>A guide to establishing connections across the supported databases</wrap>
 +</WRAP>
 +----------------------------
 +<WRAP>
 +<wrap left 180px>[[project:include_file_guide|Include File Guide]]</wrap>
 +<wrap left 450px>Include file requirements for the various features</wrap>
 +</WRAP>
 +----------------------------
 +<WRAP>
 +<wrap left 180px>[[v5:userguide:portable_sql|Writing Portable SQL]]</wrap>
 +<wrap left 450px>Limiting SQL statements to ensure cross database portability</wrap>
 +</WRAP>
 +----------------------------
 +<WRAP>
 +<wrap left 180px>[[v5:userguide:mysql_tutorial]]</wrap>
 +<wrap left 450px>How to migrate database specific applications to ADOdb</wrap>
 +</WRAP>
 +----------------------------
 +<WRAP>
 +<wrap left 180px>[[v5:userguide:error_handling|Customizing Error Handling]]</wrap>
 +<wrap left 450px>Trapping and redirecting database errors using exceptions</wrap>
 +</WRAP>
 +----------------------------
 +<WRAP>
 +<wrap left 180px>[[v5:userguide:stored_procedure|Stored Procedure Example]]</wrap>
 +<wrap left 450px>How to use stored procedures in the supported databases</wrap>
 +</WRAP>
 +-----------------------------
 +<WRAP>
 +<wrap left 180px>[[v5:database:feature_comparison|Feature Comparison Matrix]]</wrap>
 +<wrap left 450px>Supported database feature</wrap>
 +</WRAP>
 +----------------------------
 +<WRAP>
 +<wrap left 180px>[[v5:userguide:deprecated|Deprecated Functionality]]</wrap>
 +<wrap left 450px>Unsupported features</wrap>
 +</WRAP>
v5/userguide/userguide_index.1458356420.txt.gz · Last modified: 2017/04/21 11:39 (external edit)