Location: PHPKode > projects > Son of Service > sos-0.1.6/adodb/docs/docs-adodb.htm
<html xmlns:v="urn:schemas-microsoft-com:vml"
xmlns:o="urn:schemas-microsoft-com:office:office"
xmlns:w="urn:schemas-microsoft-com:office:word"
xmlns:st1="urn:schemas-microsoft-com:office:smarttags"
xmlns="http://www.w3.org/TR/REC-html40">

<head>
<meta http-equiv=Content-Type content="text/html; charset=iso-8859-1">
<meta name=ProgId content=Word.Document>
<meta name=Generator content="Microsoft Word 11">
<meta name=Originator content="Microsoft Word 11">
<link rel=File-List href="docs-adodb_files/filelist.xml">
<link rel=Edit-Time-Data href="docs-adodb_files/editdata.mso">
<!--[if !mso]>
<style>
v\:* {behavior:url(#default#VML);}
o\:* {behavior:url(#default#VML);}
w\:* {behavior:url(#default#VML);}
.shape {behavior:url(#default#VML);}
</style>
<![endif]-->
<title>ADODB Manual</title>
<o:SmartTagType namespaceuri="urn:schemas-microsoft-com:office:smarttags"
 name="State"/>
<o:SmartTagType namespaceuri="urn:schemas-microsoft-com:office:smarttags"
 name="PlaceType"/>
<o:SmartTagType namespaceuri="urn:schemas-microsoft-com:office:smarttags"
 name="PlaceName"/>
<o:SmartTagType namespaceuri="urn:schemas-microsoft-com:office:smarttags"
 name="country-region"/>
<o:SmartTagType namespaceuri="urn:schemas-microsoft-com:office:smarttags"
 name="City"/>
<o:SmartTagType namespaceuri="urn:schemas-microsoft-com:office:smarttags"
 name="place"/>
<!--[if gte mso 9]><xml>
 <o:DocumentProperties>
  <o:Author>John</o:Author>
  <o:LastAuthor>John</o:LastAuthor>
  <o:Revision>3</o:Revision>
  <o:TotalTime>3</o:TotalTime>
  <o:Created>2008-12-24T10:43:00Z</o:Created>
  <o:LastSaved>2008-12-24T10:46:00Z</o:LastSaved>
  <o:Pages>73</o:Pages>
  <o:Words>30239</o:Words>
  <o:Characters>172366</o:Characters>
  <o:Company> </o:Company>
  <o:Lines>1436</o:Lines>
  <o:Paragraphs>404</o:Paragraphs>
  <o:CharactersWithSpaces>202201</o:CharactersWithSpaces>
  <o:Version>11.9999</o:Version>
 </o:DocumentProperties>
</xml><![endif]--><!--[if gte mso 9]><xml>
 <w:WordDocument>
  <w:Zoom>140</w:Zoom>
  <w:FormsDesign/>
  <w:ValidateAgainstSchemas/>
  <w:SaveIfXMLInvalid>false</w:SaveIfXMLInvalid>
  <w:IgnoreMixedContent>false</w:IgnoreMixedContent>
  <w:AlwaysShowPlaceholderText>false</w:AlwaysShowPlaceholderText>
  <w:BrowserLevel>MicrosoftInternetExplorer4</w:BrowserLevel>
 </w:WordDocument>
</xml><![endif]--><!--[if gte mso 9]><xml>
 <w:LatentStyles DefLockedState="false" LatentStyleCount="156">
 </w:LatentStyles>
</xml><![endif]--><!--[if !mso]><object
 classid="clsid:38481807-CA0E-42D2-BF39-B33AF135CC4D" id=ieooui></object>
<style>
st1\:*{behavior:url(#ieooui) }
</style>
<![endif]-->
<style>
<!--
f


 /* Font Definitions */
 @font-face
	{font-family:Helvetica;
	panose-1:2 11 6 4 2 2 2 2 2 4;
	mso-font-charset:0;
	mso-generic-font-family:swiss;
	mso-font-format:other;
	mso-font-pitch:variable;
	mso-font-signature:3 0 0 0 1 0;}
@font-face
	{font-family:Courier;
	panose-1:2 7 4 9 2 2 5 2 4 4;
	mso-font-charset:0;
	mso-generic-font-family:modern;
	mso-font-format:other;
	mso-font-pitch:fixed;
	mso-font-signature:3 0 0 0 1 0;}
@font-face
	{font-family:"Tms Rmn";
	panose-1:2 2 6 3 4 5 5 2 3 4;
	mso-font-charset:0;
	mso-generic-font-family:roman;
	mso-font-format:other;
	mso-font-pitch:variable;
	mso-font-signature:3 0 0 0 1 0;}
@font-face
	{font-family:Helv;
	panose-1:2 11 6 4 2 2 2 3 2 4;
	mso-font-charset:0;
	mso-generic-font-family:swiss;
	mso-font-format:other;
	mso-font-pitch:variable;
	mso-font-signature:3 0 0 0 1 0;}
@font-face
	{font-family:"New York";
	panose-1:2 4 5 3 6 5 6 2 3 4;
	mso-font-charset:0;
	mso-generic-font-family:roman;
	mso-font-format:other;
	mso-font-pitch:variable;
	mso-font-signature:3 0 0 0 1 0;}
@font-face
	{font-family:System;
	panose-1:0 0 0 0 0 0 0 0 0 0;
	mso-font-charset:0;
	mso-generic-font-family:swiss;
	mso-font-format:other;
	mso-font-pitch:variable;
	mso-font-signature:3 0 0 0 1 0;}
@font-face
	{font-family:Wingdings;
	panose-1:5 0 0 0 0 0 0 0 0 0;
	mso-font-charset:2;
	mso-generic-font-family:auto;
	mso-font-pitch:variable;
	mso-font-signature:0 268435456 0 0 -2147483648 0;}
@font-face
	{font-family:"MS Mincho";
	panose-1:2 2 6 9 4 2 5 8 3 4;
	mso-font-alt:"\FF2D\FF33 \660E\671D";
	mso-font-charset:128;
	mso-generic-font-family:roman;
	mso-font-format:other;
	mso-font-pitch:fixed;
	mso-font-signature:1 134676480 16 0 131072 0;}
@font-face
	{font-family:Batang;
	panose-1:2 3 6 0 0 1 1 1 1 1;
	mso-font-alt:\BC14\D0D5;
	mso-font-charset:129;
	mso-generic-font-family:auto;
	mso-font-format:other;
	mso-font-pitch:fixed;
	mso-font-signature:1 151388160 16 0 524288 0;}
@font-face
	{font-family:SimSun;
	panose-1:2 1 6 0 3 1 1 1 1 1;
	mso-font-alt:\5B8B\4F53;
	mso-font-charset:134;
	mso-generic-font-family:auto;
	mso-font-format:other;
	mso-font-pitch:variable;
	mso-font-signature:1 135135232 16 0 262144 0;}
@font-face
	{font-family:PMingLiU;
	panose-1:2 2 3 0 0 0 0 0 0 0;
	mso-font-alt:\65B0\7D30\660E\9AD4;
	mso-font-charset:136;
	mso-generic-font-family:auto;
	mso-font-format:other;
	mso-font-pitch:variable;
	mso-font-signature:1 134742016 16 0 1048576 0;}
@font-face
	{font-family:"MS Gothic";
	panose-1:2 11 6 9 7 2 5 8 2 4;
	mso-font-alt:"\FF2D\FF33 \30B4\30B7\30C3\30AF";
	mso-font-charset:128;
	mso-generic-font-family:modern;
	mso-font-format:other;
	mso-font-pitch:fixed;
	mso-font-signature:1 134676480 16 0 131072 0;}
@font-face
	{font-family:Dotum;
	panose-1:2 11 6 0 0 1 1 1 1 1;
	mso-font-alt:\B3CB\C6C0;
	mso-font-charset:129;
	mso-generic-font-family:modern;
	mso-font-format:other;
	mso-font-pitch:fixed;
	mso-font-signature:1 151388160 16 0 524288 0;}
@font-face
	{font-family:SimHei;
	panose-1:2 1 6 0 3 1 1 1 1 1;
	mso-font-alt:\9ED1\4F53;
	mso-font-charset:134;
	mso-generic-font-family:modern;
	mso-font-format:other;
	mso-font-pitch:fixed;
	mso-font-signature:1 135135232 16 0 262144 0;}
@font-face
	{font-family:MingLiU;
	panose-1:2 2 3 9 0 0 0 0 0 0;
	mso-font-alt:\7D30\660E\9AD4;
	mso-font-charset:136;
	mso-generic-font-family:modern;
	mso-font-format:other;
	mso-font-pitch:fixed;
	mso-font-signature:1 134742016 16 0 1048576 0;}
@font-face
	{font-family:Mincho;
	panose-1:2 2 6 9 4 3 5 8 3 5;
	mso-font-alt:\660E\671D;
	mso-font-charset:128;
	mso-generic-font-family:roman;
	mso-font-format:other;
	mso-font-pitch:fixed;
	mso-font-signature:1 134676480 16 0 131072 0;}
@font-face
	{font-family:Gulim;
	panose-1:2 11 6 0 0 1 1 1 1 1;
	mso-font-alt:\AD74\B9BC;
	mso-font-charset:129;
	mso-generic-font-family:roman;
	mso-font-format:other;
	mso-font-pitch:fixed;
	mso-font-signature:1 151388160 16 0 524288 0;}
@font-face
	{font-family:Century;
	panose-1:2 4 6 4 5 5 5 2 3 4;
	mso-font-charset:0;
	mso-generic-font-family:roman;
	mso-font-format:other;
	mso-font-pitch:variable;
	mso-font-signature:3 0 0 0 1 0;}
@font-face
	{font-family:"Angsana New";
	panose-1:2 2 6 3 5 4 5 2 3 4;
	mso-font-charset:222;
	mso-generic-font-family:roman;
	mso-font-format:other;
	mso-font-pitch:variable;
	mso-font-signature:16777217 0 0 0 65536 0;}
@font-face
	{font-family:"Cordia New";
	panose-1:2 11 3 4 2 2 2 2 2 4;
	mso-font-charset:222;
	mso-generic-font-family:roman;
	mso-font-format:other;
	mso-font-pitch:variable;
	mso-font-signature:16777217 0 0 0 65536 0;}
@font-face
	{font-family:Mangal;
	panose-1:0 0 4 0 0 0 0 0 0 0;
	mso-font-charset:1;
	mso-generic-font-family:roman;
	mso-font-format:other;
	mso-font-pitch:variable;
	mso-font-signature:32768 0 0 0 0 0;}
@font-face
	{font-family:Latha;
	panose-1:2 0 4 0 0 0 0 0 0 0;
	mso-font-charset:1;
	mso-generic-font-family:roman;
	mso-font-format:other;
	mso-font-pitch:variable;
	mso-font-signature:1048576 0 0 0 0 0;}
@font-face
	{font-family:Sylfaen;
	panose-1:1 10 5 2 5 3 6 3 3 3;
	mso-font-charset:0;
	mso-generic-font-family:roman;
	mso-font-format:other;
	mso-font-pitch:variable;
	mso-font-signature:16778883 0 512 0 13 0;}
@font-face
	{font-family:Vrinda;
	panose-1:0 0 4 0 0 0 0 0 0 0;
	mso-font-charset:1;
	mso-generic-font-family:roman;
	mso-font-format:other;
	mso-font-pitch:variable;
	mso-font-signature:0 0 0 0 0 0;}
@font-face
	{font-family:Raavi;
	panose-1:2 0 5 0 0 0 0 0 0 0;
	mso-font-charset:1;
	mso-generic-font-family:roman;
	mso-font-format:other;
	mso-font-pitch:variable;
	mso-font-signature:0 0 0 0 0 0;}
@font-face
	{font-family:Shruti;
	panose-1:2 0 5 0 0 0 0 0 0 0;
	mso-font-charset:1;
	mso-generic-font-family:roman;
	mso-font-format:other;
	mso-font-pitch:variable;
	mso-font-signature:0 0 0 0 0 0;}
@font-face
	{font-family:Sendnya;
	panose-1:0 0 4 0 0 0 0 0 0 0;
	mso-font-charset:1;
	mso-generic-font-family:roman;
	mso-font-format:other;
	mso-font-pitch:variable;
	mso-font-signature:0 0 0 0 0 0;}
@font-face
	{font-family:Gautami;
	panose-1:2 0 5 0 0 0 0 0 0 0;
	mso-font-charset:1;
	mso-generic-font-family:roman;
	mso-font-format:other;
	mso-font-pitch:variable;
	mso-font-signature:0 0 0 0 0 0;}
@font-face
	{font-family:Tunga;
	panose-1:0 0 4 0 0 0 0 0 0 0;
	mso-font-charset:1;
	mso-generic-font-family:roman;
	mso-font-format:other;
	mso-font-pitch:variable;
	mso-font-signature:0 0 0 0 0 0;}
@font-face
	{font-family:"Estrangelo Edessa";
	panose-1:0 0 0 0 0 0 0 0 0 0;
	mso-font-charset:1;
	mso-generic-font-family:roman;
	mso-font-format:other;
	mso-font-pitch:variable;
	mso-font-signature:0 0 0 0 0 0;}
@font-face
	{font-family:Kartika;
	panose-1:1 1 1 0 1 1 1 1 1 1;
	mso-font-charset:1;
	mso-generic-font-family:roman;
	mso-font-format:other;
	mso-font-pitch:variable;
	mso-font-signature:0 0 0 0 0 0;}
@font-face
	{font-family:"Arial Unicode MS";
	panose-1:2 11 6 4 2 2 2 2 2 4;
	mso-font-charset:0;
	mso-generic-font-family:roman;
	mso-font-format:other;
	mso-font-pitch:variable;
	mso-font-signature:3 0 0 0 1 0;}
@font-face
	{font-family:Tahoma;
	panose-1:2 11 6 4 3 5 4 4 2 4;
	mso-font-charset:0;
	mso-generic-font-family:swiss;
	mso-font-format:other;
	mso-font-pitch:variable;
	mso-font-signature:3 0 0 0 1 0;}
 /* Style Definitions */
 p.MsoNormal, li.MsoNormal, div.MsoNormal
	{mso-style-parent:"";
	margin:0cm;
	margin-bottom:.0001pt;
	mso-pagination:widow-orphan;
	font-size:12.0pt;
	font-family:"Times New Roman";
	mso-fareast-font-family:"Times New Roman";
	color:black;}
h1
	{mso-margin-top-alt:auto;
	margin-right:0cm;
	mso-margin-bottom-alt:auto;
	margin-left:0cm;
	mso-pagination:widow-orphan;
	mso-outline-level:1;
	font-size:24.0pt;
	font-family:"Times New Roman";
	color:black;
	font-weight:bold;}
h2
	{mso-margin-top-alt:auto;
	margin-right:0cm;
	mso-margin-bottom-alt:auto;
	margin-left:0cm;
	mso-pagination:widow-orphan;
	mso-outline-level:2;
	font-size:18.0pt;
	font-family:"Times New Roman";
	color:black;
	font-weight:bold;}
h3
	{mso-margin-top-alt:auto;
	margin-right:0cm;
	mso-margin-bottom-alt:auto;
	margin-left:0cm;
	mso-pagination:widow-orphan;
	mso-outline-level:3;
	font-size:13.5pt;
	font-family:"Times New Roman";
	color:black;
	font-weight:bold;}
h4
	{mso-margin-top-alt:auto;
	margin-right:0cm;
	mso-margin-bottom-alt:auto;
	margin-left:0cm;
	mso-pagination:widow-orphan;
	mso-outline-level:4;
	font-size:12.0pt;
	font-family:"Times New Roman";
	color:black;
	font-weight:bold;}
a:link, span.MsoHyperlink
	{color:blue;
	text-decoration:underline;
	text-underline:single;}
a:visited, span.MsoHyperlinkFollowed
	{color:blue;
	text-decoration:underline;
	text-underline:single;}
p
	{font-size:12.0pt;
	font-family:"Times New Roman";
	mso-fareast-font-family:"Times New Roman";
	color:black;}
code
	{font-family:"Courier New";
	mso-ascii-font-family:"Courier New";
	mso-fareast-font-family:"Times New Roman";
	mso-hansi-font-family:"Courier New";
	mso-bidi-font-family:"Courier New";}
pre
	{margin:0cm;
	margin-bottom:.0001pt;
	mso-pagination:widow-orphan;
	tab-stops:45.8pt 91.6pt 137.4pt 183.2pt 229.0pt 274.8pt 320.6pt 366.4pt 412.2pt 458.0pt 503.8pt 549.6pt 595.4pt 641.2pt 687.0pt 732.8pt;
	background:#EEEEEE;
	border:none;
	mso-border-alt:solid #DDDDDD .75pt;
	padding:0cm;
	mso-padding-alt:9.0pt 18.0pt 9.0pt 18.0pt;
	font-size:9.0pt;
	font-family:"Courier New";
	mso-fareast-font-family:"Times New Roman";
	color:black;}
span.msoIns
	{mso-style-type:export-only;
	mso-style-name:"";
	text-decoration:underline;
	text-underline:single;
	color:teal;}
span.msoDel
	{mso-style-type:export-only;
	mso-style-name:"";
	text-decoration:line-through;
	color:red;}
span.msoChangeProp
	{mso-style-type:export-only;
	mso-style-name:"";}
@page Section1
	{size:612.0pt 792.0pt;
	margin:72.0pt 90.0pt 72.0pt 90.0pt;
	mso-header-margin:35.4pt;
	mso-footer-margin:35.4pt;
	mso-paper-source:0;}
div.Section1
	{page:Section1;}
 /* List Definitions */
 @list l0
	{mso-list-id:3098366;
	mso-list-template-ids:-1654113918;}
@list l0:level1
	{mso-level-number-format:bullet;
	mso-level-text:\F0B7;
	mso-level-tab-stop:36.0pt;
	mso-level-number-position:left;
	text-indent:-18.0pt;
	mso-ansi-font-size:10.0pt;
	font-family:Symbol;}
@list l1
	{mso-list-id:118686534;
	mso-list-template-ids:1789952844;}
@list l1:level1
	{mso-level-number-format:bullet;
	mso-level-text:\F0B7;
	mso-level-tab-stop:36.0pt;
	mso-level-number-position:left;
	text-indent:-18.0pt;
	mso-ansi-font-size:10.0pt;
	font-family:Symbol;}
@list l2
	{mso-list-id:325595838;
	mso-list-template-ids:-924547596;}
@list l2:level1
	{mso-level-number-format:bullet;
	mso-level-text:\F0B7;
	mso-level-tab-stop:36.0pt;
	mso-level-number-position:left;
	text-indent:-18.0pt;
	mso-ansi-font-size:10.0pt;
	font-family:Symbol;}
@list l3
	{mso-list-id:577053254;
	mso-list-template-ids:1006266472;}
@list l3:level1
	{mso-level-number-format:bullet;
	mso-level-text:\F0B7;
	mso-level-tab-stop:36.0pt;
	mso-level-number-position:left;
	text-indent:-18.0pt;
	mso-ansi-font-size:10.0pt;
	font-family:Symbol;}
@list l4
	{mso-list-id:584261941;
	mso-list-template-ids:1672376844;}
@list l4:level1
	{mso-level-number-format:bullet;
	mso-level-text:\F0B7;
	mso-level-tab-stop:36.0pt;
	mso-level-number-position:left;
	text-indent:-18.0pt;
	mso-ansi-font-size:10.0pt;
	font-family:Symbol;}
@list l5
	{mso-list-id:678311197;
	mso-list-template-ids:-1025849406;}
@list l5:level1
	{mso-level-number-format:bullet;
	mso-level-text:\F0B7;
	mso-level-tab-stop:36.0pt;
	mso-level-number-position:left;
	text-indent:-18.0pt;
	mso-ansi-font-size:10.0pt;
	font-family:Symbol;}
@list l6
	{mso-list-id:993068284;
	mso-list-template-ids:-1149100626;}
@list l6:level1
	{mso-level-number-format:bullet;
	mso-level-text:\F0B7;
	mso-level-tab-stop:36.0pt;
	mso-level-number-position:left;
	text-indent:-18.0pt;
	mso-ansi-font-size:10.0pt;
	font-family:Symbol;}
@list l7
	{mso-list-id:1120344907;
	mso-list-template-ids:-1732590280;}
@list l7:level1
	{mso-level-number-format:bullet;
	mso-level-text:\F0B7;
	mso-level-tab-stop:36.0pt;
	mso-level-number-position:left;
	text-indent:-18.0pt;
	mso-ansi-font-size:10.0pt;
	font-family:Symbol;}
@list l8
	{mso-list-id:1134718884;
	mso-list-template-ids:-1854392276;}
@list l8:level1
	{mso-level-number-format:bullet;
	mso-level-text:\F0B7;
	mso-level-tab-stop:36.0pt;
	mso-level-number-position:left;
	text-indent:-18.0pt;
	mso-ansi-font-size:10.0pt;
	font-family:Symbol;}
@list l9
	{mso-list-id:1289897560;
	mso-list-template-ids:-1284101662;}
@list l9:level1
	{mso-level-number-format:bullet;
	mso-level-text:\F0B7;
	mso-level-tab-stop:36.0pt;
	mso-level-number-position:left;
	text-indent:-18.0pt;
	mso-ansi-font-size:10.0pt;
	font-family:Symbol;}
@list l10
	{mso-list-id:1461026030;
	mso-list-template-ids:65944450;}
@list l11
	{mso-list-id:1566380536;
	mso-list-template-ids:395727058;}
@list l11:level1
	{mso-level-number-format:bullet;
	mso-level-text:\F0B7;
	mso-level-tab-stop:36.0pt;
	mso-level-number-position:left;
	text-indent:-18.0pt;
	mso-ansi-font-size:10.0pt;
	font-family:Symbol;}
ol
	{margin-bottom:0cm;}
ul
	{margin-bottom:0cm;}
-->
</style>
<!--[if gte mso 10]>
<style>
 /* Style Definitions */
 table.MsoNormalTable
	{mso-style-name:"Table Normal";
	mso-tstyle-rowband-size:0;
	mso-tstyle-colband-size:0;
	mso-style-noshow:yes;
	mso-style-parent:"";
	mso-padding-alt:0cm 5.4pt 0cm 5.4pt;
	mso-para-margin:0cm;
	mso-para-margin-bottom:.0001pt;
	mso-pagination:widow-orphan;
	font-size:10.0pt;
	font-family:"Times New Roman";
	mso-ansi-language:#0400;
	mso-fareast-language:#0400;
	mso-bidi-language:#0400;}
</style>
<![endif]--><!--[if gte mso 9]><xml>
 <o:shapedefaults v:ext="edit" spidmax="1026"/>
</xml><![endif]--><!--[if gte mso 9]><xml>
 <o:shapelayout v:ext="edit">
  <o:idmap v:ext="edit" data="1"/>
 </o:shapelayout></xml><![endif]-->
</head>

<body bgcolor=white lang=EN-US link=blue vlink=blue style='tab-interval:36.0pt'>

<div class=Section1>

<h2>ADOdb Library for PHP</h2>

<p>V5.06 16 Oct 2008 (c) 2000-2008 John Lim (jlim#natsoft.com)</p>

<p><span style='font-size:7.5pt'>This software is dual licensed using BSD-Style
and LGPL. This means you can use it in compiled proprietary and commercial
products.</span></p>

<p>Useful ADOdb links: <a href="http://adodb.sourceforge.net/#download">Download</a>
&nbsp; <a href="http://adodb.sourceforge.net/#docs">Other Docs</a> </p>

<p><a href="#intro"><b>Introduction</b></a><b><br>
<a href="#features">Unique Features</a><br>
<a href="#users">How People are using ADOdb</a><br>
<a href="#bugs">Feature Requests and Bug Reports</a><br>
<a href="#install">Installation</a><br>
<a href="#mininstall">Minimum Install</a><br>
<a href="#coding">Initializing Code and Connectioning to Databases</a><br>
</b><span style='font-size:10.0pt'>&nbsp; <a href="#dsnsupport">Data Source
Name (DSN) Support</a></span> &nbsp; <a href="#connect_ex">Connection Examples</a>
<br>
<b><a href="#speed">High Speed ADOdb - tuning tips</a></b><br>
<b><a href="#hack">Hacking and Modifying ADOdb Safely</a><br>
<a href="#php5">PHP5 Features</a></b><br>
<span style='font-size:10.0pt'><a href="#php5iterators">foreach iterators</a> <a
href="#php5exceptions">exceptions</a></span><br>
<b><a href="#drivers">Supported Databases</a></b><br>
<b><a href="#quickstart">Tutorials</a></b><br>
<a href="#ex1">Example 1: Select</a><br>
<a href="#ex2">Example 2: Advanced Select</a><br>
<a href="#ex3">Example 3: Insert</a><br>
<a href="#ex4">Example 4: Debugging</a> &nbsp;<a href="#exrs2html">rs2html
example</a><br>
<a href="#ex5">Example 5: MySQL and Menus</a><br>
<a href="#ex6">Example 6: Connecting to Multiple Databases at once</a> <br>
<a href="#ex7">Example 7: Generating Update and Insert SQL</a> <br>
<a href="#ex8">Example 8: Implementing Scrolling with Next and Previous</a><br>
<a href="#ex9">Example 9: Exporting in CSV or Tab-Delimited Format</a> <br>
<a href="#ex10">Example 10: Custom filters</a><br>
<a href="#ex11">Example 11: Smart Transactions</a><br>
<br>
<b><a href="#errorhandling">Using Custom Error Handlers and PEAR_Error</a><br>
<a href="#DSN">Data Source Names</a><br>
<a href="#caching">Caching</a></b><br>
&nbsp; &nbsp; <a href="#memcache">MemCache</a><br>
&nbsp; &nbsp; <a href="#cacheapi">Caching API</a><br>
<b><a href="#pivot">Pivot Tables</a></b> </p>

<p><a href="#ref"><b>REFERENCE</b></a> </p>

<p><span style='font-size:10.0pt'>Variables: <a href="#adodb_countrecs">$ADODB_COUNTRECS</a>
<a href="#adodb_ansi_padding_off">$ADODB_ANSI_PADDING_OFF</a> <a
href="#adodb_cache_dir">$ADODB_CACHE_DIR</a> <br>
&nbsp; &nbsp; &nbsp; &nbsp; <a href="#force_type">$ADODB_FORCE_TYPE</a> <a
href="#adodb_fetch_mode">$ADODB_FETCH_MODE</a> <a href="#adodb_lang">$ADODB_LANG</a>
<a href="#adodb_auto_quote">ADODB_QUOTE_FIELDNAMES</a> <br>
Constants: <a href="#adodb_assoc_case">ADODB_ASSOC_CASE</a> </span><br>
<a href="#ADOConnection"><b>ADOConnection</b></a><br>
<span style='font-size:10.0pt'>Connections: <a href="#connect">Connect</a> <a
href="#pconnect">PConnect</a> <a href="#nconnect">NConnect</a> <a
href="#isconnected">IsConnected</a><br>
Executing SQL: <a href="#execute">Execute</a> <a href="#cacheexecute"><i>CacheExecute</i></a>
<a href="#selectlimit">SelectLimit</a> <a href="#cacheSelectLimit"><i>CacheSelectLimit</i></a>
<a href="#param">Param</a> <a href="#prepare">Prepare</a> <a href="#preparesp">PrepareSP</a>
<a href="#inparameter">InParameter</a> <a href="#outparameter">OutParameter</a>
<a href="#autoexecute">AutoExecute</a> <br>
&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <a
href="#getone">GetOne</a> <a href="#cachegetone"><i>CacheGetOne</i></a> <a
href="#getrow">GetRow</a> <a href="#cachegetrow"><i>CacheGetRow</i></a> <a
href="#getall">GetAll</a> <a href="#cachegetall"><i>CacheGetAll</i></a> <a
href="#getcol">GetCol</a> <a href="#cachegetcol"><i>CacheGetCol</i></a> <a
href="#getassoc1">GetAssoc</a> <a href="#cachegetassoc"><i>CacheGetAssoc</i></a>
<a href="#replace">Replace</a> <a href="#getmedian">GetMedian</a> <br>
&nbsp; &nbsp; &nbsp; &nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <a
href="#executecursor">ExecuteCursor</a> (oci8 only)<br>
Generates SQL strings: <a href="#getupdatesql">GetUpdateSQL</a> <a
href="#getinsertsql">GetInsertSQL</a> <a href="#concat">Concat</a> <a
href="#ifnull">IfNull</a> <a href="#length">length</a> <a href="#random">random</a>
<a href="#substr">substr</a> <a href="#qstr">qstr</a> <a href="#param">Param</a>
<a href="#OffsetDate">OffsetDate</a> <a href="#sqldate">SQLDate</a> <a
href="#dbdate">DBDate</a> <a href="#dbtimestamp">DBTimeStamp</a> <a
href="#binddate">BindDate</a> <a href="#bindtimestamp">BindTimeStamp</a> <br>
Blobs: <a href="#updateblob">UpdateBlob</a> <a href="#updateclob">UpdateClob</a>
<a href="#updateblobfile">UpdateBlobFile</a> <a href="#blobencode">BlobEncode</a>
<a href="#blobdecode">BlobDecode</a><br>
Paging/Scrolling: <a href="#pageexecute">PageExecute</a> <a
href="#cachepageexecute">CachePageExecute</a><br>
Cleanup: <a href="#cacheflush">CacheFlush</a> <a href="#Close">Close</a><br>
Transactions: <a href="#starttrans">StartTrans</a> <a href="#completetrans">CompleteTrans</a>
<a href="#failtrans">FailTrans</a> <a href="#hasfailedtrans">HasFailedTrans</a>
<a href="#begintrans">BeginTrans</a> <a href="#committrans">CommitTrans</a> <a
href="#rollbacktrans">RollbackTrans</a> <a href="#SetTransactionMode">SetTransactionMode</a><br>
Fetching Data: <a href="#setfetchmode">SetFetchMode</a><br>
Strings: <a href="#concat">concat</a> <a href="#length">length</a> <a
href="#qstr">qstr</a> <a href="#quote">quote</a> <a href="#substr">substr</a><br>
Dates: <a href="#dbdate">DBDate</a> <a href="#dbtimestamp">DBTimeStamp</a> <a
href="#unixdate">UnixDate</a> <a href="#binddate">BindDate</a> <a
href="#bindtimestamp">BindTimeStamp</a> <a href="#unixtimestamp">UnixTimeStamp</a>
<a href="#OffsetDate">OffsetDate</a> <a href="#SQLDate">SQLDate</a> <br>
Row Management: <a href="#affected_rows">Affected_Rows</a> <a
href="#inserted_id">Insert_ID</a> <a href="#rowlock">RowLock</a> <a
href="#genid">GenID</a> <a href="#createseq">CreateSequence</a> <a
href="#dropseq">DropSequence</a> <br>
Error Handling: <a href="#errormsg">ErrorMsg</a> <a href="#errorno">ErrorNo</a>
<a href="#metaerror">MetaError</a> <a href="#metaerrormsg">MetaErrorMsg</a> <a
href="#ignoreerrors">IgnoreErrors</a><br>
Data Dictionary (metadata): <a href="#metadatabases">MetaDatabases</a> <a
href="#metatables">MetaTables</a> <a href="#metacolumns">MetaColumns</a> <a
href="#metacolumnames">MetaColumnNames</a> <a href="#metaprimarykeys">MetaPrimaryKeys</a>
<a href="#metaforeignkeys">MetaForeignKeys</a> <a href="#serverinfo">ServerInfo</a>
<br>
Statistics and Query-Rewriting: <a href="#logsql">LogSQL</a> <a
href="#fnexecute">fnExecute and fnCacheExecute</a><br>
Deprecated: <a href="#bind">Bind</a> <a href="#blankrecordset">BlankRecordSet</a>
<a href="#parameter">Parameter</a></span> <a href="#adorecordSet"><b><br>
ADORecordSet</b></a><br>
<span style='font-size:10.0pt'>Returns one field: <a href="#fields">Fields</a><br>
Returns one row:<a href="#fetchrow">FetchRow</a> <a href="#fetchinto">FetchInto</a>
<a href="#fetchobject">FetchObject</a> <a href="#fetchnextobject">FetchNextObject</a>
<a href="#fetchobj">FetchObj</a> <a href="#fetchnextobj">FetchNextObj</a> <a
href="#getrowassoc">GetRowAssoc</a> <br>
Returns all rows:<a href="#getarray">GetArray</a> <a href="#getrows">GetRows</a>
<a href="#getassoc">GetAssoc</a><br>
Scrolling:<a href="#move">Move</a> <a href="#movenext">MoveNext</a> <a
href="#movefirst">MoveFirst</a> <a href="#movelast">MoveLast</a> <a
href="#abspos">AbsolutePosition</a> <a href="#currentrow">CurrentRow</a> <a
href="#atfirstpage">AtFirstPage</a> <a href="#atlastpage">AtLastPage</a> <a
href="#absolutepage">AbsolutePage</a> <br>
Menu generation:<a href="#getmenu">GetMenu</a> <a href="#getmenu2">GetMenu2</a><br>
Dates:<a href="#userdate">UserDate</a> <a href="#usertimestamp">UserTimeStamp</a>
<a href="#unixdate">UnixDate</a> <a href="#unixtimestamp">UnixTimeStamp<br>
</a>Recordset Info:<a href="#recordcount">RecordCount</a> <a
href="#po_recordcount">PO_RecordCount</a> <a href="#nextrecordset">NextRecordSet</a><br>
Field Info:<a href="#fieldcount">FieldCount</a> <a href="#fetchfield">FetchField</a>
<a href="#metatype">MetaType</a><br>
Cleanup: <a href="#rsclose">Close</a></span> </p>

<p><span style='font-size:10.0pt'><a href="#rs2html"><b>rs2html</b></a>&nbsp; <a
href="#exrs2html">example</a></span><br>
<a href="#adodiff">Differences between ADOdb and ADO</a><br>
<a href="#driverguide"><b>Database Driver Guide<br>
</b></a><b><a href="#changes">Change Log</a></b></p>

<h2>Introduction<a name=intro></a></h2>

<p>PHP's database access functions are not standardised. This creates a need
for a database class library to hide the differences between the different
database API's (encapsulate the differences) so we can easily switch databases.
PHP 4.0.5 or later is now required (because we use array-based str_replace).</p>

<p>We currently support MySQL, Oracle, Microsoft SQL Server, Sybase, Sybase SQL
Anywhere, Informix, PostgreSQL, FrontBase, SQLite, Interbase (Firebird and
Borland variants), Foxpro, Access, <st1:City w:st="on"><st1:place w:st="on">ADO</st1:place></st1:City>,
DB2, SAP DB and ODBC. We have had successful reports of connecting to Progress
and CacheLite via ODBC. We hope more people will contribute drivers to support
other databases.</p>

<p>PHP4 supports session variables. You can store your session information
using ADOdb for true portability and scalability. See adodb-session.php for
more information.</p>

<p>Also read <a href="http://phplens.com/lens/adodb/tips_portable_sql.htm">tips_portable_sql.htm</a>
for tips on writing portable SQL.</p>

<h2>Unique Features of ADOdb<a name=features></a></h2>

<ul type=disc>
 <li class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;
     mso-list:l2 level1 lfo1;tab-stops:list 36.0pt'><b>Easy for Windows
     programmers</b> to adapt to because many of the conventions are similar to
     Microsoft's <st1:City w:st="on"><st1:place w:st="on">ADO</st1:place></st1:City>.</li>
 <li class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;
     mso-list:l2 level1 lfo1;tab-stops:list 36.0pt'>Unlike other PHP database
     classes which focus only on select statements, <b>we provide support code
     to handle inserts and updates which can be adapted to multiple databases
     quickly.</b> Methods are provided for date handling, string concatenation
     and string quoting characters for differing databases.</li>
 <li class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;
     mso-list:l2 level1 lfo1;tab-stops:list 36.0pt'>A<b> metatype system </b>is
     built in so that we can figure out that types such as CHAR, TEXT and
     STRING are equivalent in different databases.</li>
 <li class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;
     mso-list:l2 level1 lfo1;tab-stops:list 36.0pt'><b>Easy to port</b> because
     all the database dependant code are stored in stub functions. You do not
     need to port the core logic of the classes.</li>
 <li class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;
     mso-list:l2 level1 lfo1;tab-stops:list 36.0pt'><b>Portable table and index
     creation</b> with the <a href="docs-datadict.htm">datadict</a> classes. </li>
 <li class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;
     mso-list:l2 level1 lfo1;tab-stops:list 36.0pt'><b>Database performance
     monitoring and SQL tuning</b> with the <a href="docs-perf.htm">performance
     monitoring</a> classes. </li>
 <li class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;
     mso-list:l2 level1 lfo1;tab-stops:list 36.0pt'><b>Database-backed sessions</b>
     with the <a href="docs-session.htm">session management</a> classes.
     Supports session expiry notification. </li>
 <li class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;
     mso-list:l2 level1 lfo1;tab-stops:list 36.0pt'><b>Object-Relational
     Mapping</b> using <a href="docs-active-record.htm">ADOdb_Active_Record</a>
     classes. </li>
</ul>

<h2>How People are using ADOdb<a name=users></a></h2>

<p class=MsoNormal>Here are some examples of how people are using ADOdb (for a
much longer list, visit <a
href="http://phplens.com/phpeverywhere/adodb-cool-apps">adodb-cool-apps</a>): </p>

<ul type=disc>
 <li class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;
     mso-list:l4 level1 lfo2;tab-stops:list 36.0pt'><a
     href="http://phplens.com/">PhpLens</a> is a commercial data grid component
     that allows both cool Web designers and serious unshaved programmers to
     develop and maintain databases on the Web easily. Developed by the author
     of ADOdb.</li>
 <li class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;
     mso-list:l4 level1 lfo2;tab-stops:list 36.0pt'><a
     href="http://www.interakt.ro/phakt/">PHAkt: PHP Extension for DreamWeaver
     Ultradev</a> allows you to script PHP in the popular Web page editor.
     Database handling provided by ADOdb.</li>
 <li class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;
     mso-list:l4 level1 lfo2;tab-stops:list 36.0pt'><a
     href="http://www.andrew.cmu.edu/%7Erdanyliw/snort/snortacid.html">Analysis
     Console for Intrusion Databases</a> (ACID): PHP-based analysis engine to
     search and process a database of security incidents generated by
     security-related software such as IDSes and firewalls (e.g. Snort,
     ipchains). By Roman Danyliw.</li>
 <li class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;
     mso-list:l4 level1 lfo2;tab-stops:list 36.0pt'><a
     href="http://www.postnuke.com/">PostNuke</a> is a very popular free
     content management system and weblog system. It offers full CSS support,
     HTML 4.01 transitional compliance throughout, an advanced blocks system,
     and is fully multi-lingual enabled. </li>
 <li class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;
     mso-list:l4 level1 lfo2;tab-stops:list 36.0pt'><a
     href="http://www.auto-net.no/easypublish.php?page=index&amp;lang_id=2">EasyPublish
     CMS</a> is another free content management system for managing information
     and integrated modules on your internet, intranet- and extranet-sites.
     From <st1:country-region w:st="on"><st1:place w:st="on">Norway</st1:place></st1:country-region>.</li>
 <li class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;
     mso-list:l4 level1 lfo2;tab-stops:list 36.0pt'><a
     href="http://nola.noguska.com/">NOLA</a> is a full featured accounting,
     inventory, and job tracking application. It is licensed under the GPL, and
     developed by Noguska. </li>
</ul>

<h2>Feature Requests and Bug Reports<a name=bugs></a></h2>

<p>Feature requests and bug reports can be emailed to <a
href="mailto:jlim#natsoft.com">jlim#natsoft.com</a> or posted to the ADOdb Help
forums at <a href="http://phplens.com/lens/lensforum/topics.php?id=4">http://phplens.com/lens/lensforum/topics.php?id=4</a>.</p>

<h2>Installation Guide<a name=install></a></h2>

<p>Make sure you are running PHP 4.0.5 or later. Unpack all the files into a
directory accessible by your webserver.</p>

<p>To test, try modifying some of the tutorial examples. Make sure you
customize the connection settings correctly. You can debug using <i>$db-&gt;debug
= true</i> as shown below:</p>

<div style='mso-element:para-border-div;border:solid #DDDDDD 1.0pt;mso-border-alt:
solid #DDDDDD .75pt;padding:9.0pt 18.0pt 9.0pt 18.0pt;background:#EEEEEE'><pre
style='background:#EEEEEE'>&lt;?php<br>
<span style='mso-tab-count:1'>         </span>include('adodb/adodb.inc.php');<br>
<span style='mso-tab-count:1'>         </span>$db = <a href="#adonewconnection">ADONewConnection</a>($dbdriver); # eg 'mysql' or 'postgres'<br>
<span style='mso-tab-count:1'>         </span>$db-&gt;debug = true;<br>
<span style='mso-tab-count:1'>         </span>$db-&gt;<a href="#connect">Connect</a>($server, $user, $password, $database);<br>
<span style='mso-tab-count:1'>         </span>$rs = $db-&gt;<a href="#execute">Execute</a>('select * from some_small_table');<br>
<span style='mso-tab-count:1'>         </span>print &quot;&lt;pre&gt;&quot;;<br>
<span style='mso-tab-count:1'>         </span>print_r($rs-&gt;<a href="#getrows">GetRows</a>());<br>
<span style='mso-tab-count:1'>         </span>print &quot;&lt;/pre&gt;&quot;;<br>
?&gt;</pre></div>

<h3>Minimum Install<a name=mininstall></a></h3>

<p>For developers who want to release a minimal install of ADOdb, you will
need: </p>

<ul type=disc>
 <li class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;
     mso-list:l9 level1 lfo3;tab-stops:list 36.0pt'>adodb.inc.php </li>
 <li class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;
     mso-list:l9 level1 lfo3;tab-stops:list 36.0pt'>adodb-lib.inc.php </li>
 <li class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;
     mso-list:l9 level1 lfo3;tab-stops:list 36.0pt'>adodb-time.inc.php </li>
 <li class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;
     mso-list:l9 level1 lfo3;tab-stops:list 36.0pt'>drivers/adodb-$database.inc.php
     </li>
 <li class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;
     mso-list:l9 level1 lfo3;tab-stops:list 36.0pt'>license.txt (for legal
     reasons) </li>
 <li class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;
     mso-list:l9 level1 lfo3;tab-stops:list 36.0pt'>adodb-php4.inc.php </li>
 <li class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;
     mso-list:l9 level1 lfo3;tab-stops:list 36.0pt'>adodb-iterator.inc.php
     (php5 functionality) </li>
</ul>

<p class=MsoNormal>Optional: </p>

<ul type=disc>
 <li class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;
     mso-list:l3 level1 lfo4;tab-stops:list 36.0pt'>adodb-error.inc.php and
     lang/adodb-$lang.inc.php (if you use MetaError()) </li>
 <li class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;
     mso-list:l3 level1 lfo4;tab-stops:list 36.0pt'>adodb-csvlib.inc.php (if
     you use cached recordsets - CacheExecute(), etc) </li>
 <li class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;
     mso-list:l3 level1 lfo4;tab-stops:list 36.0pt'>adodb-exceptions.inc.php
     and adodb-errorhandler.inc.php (if you use adodb error handler or php5
     exceptions). </li>
 <li class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;
     mso-list:l3 level1 lfo4;tab-stops:list 36.0pt'>adodb-active-record.inc.php
     if you use <a href="docs-active-record.htm">Active Records</a>. </li>
</ul>

<h3>Code Initialization Examples<a name=coding></a></h3>

<p>When running ADOdb, at least two files are loaded. First is
adodb/adodb.inc.php, which contains all functions used by all database classes.
The code specific to a particular database is in the
adodb/driver/adodb-????.inc.php file.</p>

<p><a name=adonewconnection></a>For example, to connect to a mysql database:</p>

<div style='mso-element:para-border-div;border:solid #DDDDDD 1.0pt;mso-border-alt:
solid #DDDDDD .75pt;padding:9.0pt 18.0pt 9.0pt 18.0pt;background:#EEEEEE'><pre
style='background:#EEEEEE'>include('/path/to/set/here/adodb.inc.php');<br>
$conn = &amp;ADONewConnection('mysql');</pre></div>

<p>Whenever you need to connect to a database, you create a Connection object
using the <b>ADONewConnection</b>($driver) function. <b>NewADOConnection</b>($driver)
is an alternative name for the same function.</p>

<p>At this point, you are not connected to the database (no longer true if you
pass in a <a href="#dsnsupport">dsn</a>). You will first need to decide whether
to use <i>persistent</i> or <i>non-persistent</i> connections. The advantage of
<i>persistent</i> connections is that they are faster, as the database
connection is never closed (even when you call Close()). <i>Non-persistent </i>connections
take up much fewer resources though, reducing the risk of your database and
your web-server becoming overloaded. </p>

<p>For persistent connections, use $conn-&gt;<a href="#pconnect">PConnect()</a>,
or $conn-&gt;<a href="#connect">Connect()</a> for non-persistent connections.
Some database drivers also support <a href="#nconnect">NConnect()</a>, which
forces the creation of a new connection. <a name="connection_gotcha"></a></p>

<p><b>Connection Gotcha</b>: If you create two connections, but both use the
same userid and password, PHP will share the same connection. This can cause
problems if the connections are meant to different databases. The solution is
to always use different userid's for different databases, or use NConnect(). <a
name=dsnsupport></a></p>

<h3>Data Source Name (DSN) Support</h3>

<p>Since ADOdb 4.51, you can connect to a database by passing a dsn to
NewADOConnection() (or ADONewConnection, which is the same function). The dsn
format is: </p>

<div style='mso-element:para-border-div;border:solid #DDDDDD 1.0pt;mso-border-alt:
solid #DDDDDD .75pt;padding:9.0pt 18.0pt 9.0pt 18.0pt;background:#EEEEEE'><pre
style='background:#EEEEEE'><span style='mso-tab-count:1'>         </span>$driver://$username:$hide@address.com/$database?options[=value]</pre></div>

<p>NewADOConnection() calls Connect() or PConnect() internally for you. If the
connection fails, false is returned. </p>

<div style='mso-element:para-border-div;border:solid #DDDDDD 1.0pt;mso-border-alt:
solid #DDDDDD .75pt;padding:9.0pt 18.0pt 9.0pt 18.0pt;background:#EEEEEE'><pre><span
style='mso-tab-count:1'>         </span><span style='color:green'># non-persistent connection</span></pre><pre><span
style='mso-tab-count:1'>         </span>$dsn = 'mysql://root:hide@address.com/mydb'; </pre><pre><span
style='mso-tab-count:1'>         </span>$db = NewADOConnection($dsn);</pre><pre><span
style='mso-tab-count:1'>         </span>if (!$db) die(&quot;Connection failed&quot;);<span style='mso-spacerun:yes'>   </span></pre><pre><span
style='mso-tab-count:1'>         </span></pre><pre><span style='mso-tab-count:
1'>         </span><span style='color:green'># no need to call connect/pconnect!</span></pre><pre><span
style='mso-tab-count:1'>         </span>$arr = $db-&gt;GetArray(&quot;select * from table&quot;);</pre><pre><span
style='mso-tab-count:1'>         </span></pre><pre><span style='mso-tab-count:
1'>         </span><span style='color:green'># persistent connection</span></pre><pre><span
style='mso-tab-count:1'>         </span>$dsn2 = 'mysql://root:hide@address.com/mydb?persist'; </pre></div>

<p>If you have special characters such as /:?_ in your dsn, then you need to
rawurlencode them first: </p>

<div style='mso-element:para-border-div;border:solid #DDDDDD 1.0pt;mso-border-alt:
solid #DDDDDD .75pt;padding:9.0pt 18.0pt 9.0pt 18.0pt;background:#EEEEEE'><pre><span
style='mso-tab-count:1'>         </span>$pwd = rawurlencode($pwd);<br>
<span style='mso-tab-count:1'>         </span>$dsn = &quot;mysql://root:$hide@address.com/mydb&quot;;</pre><pre
style='background:#EEEEEE'><span style='mso-tab-count:1'>         </span>$dsn2=rawurlencode(&quot;sybase_ase&quot;).&quot;://user:hide@address.com/path?query&quot;;</pre></div>

<p>Legal options are: </p>

<div align=center>

<table class=MsoNormalTable border=1 cellpadding=0 style='mso-cellspacing:1.5pt'>
 <tr style='mso-yfti-irow:0;mso-yfti-firstrow:yes'>
  <td style='padding:.75pt .75pt .75pt .75pt'>
  <p class=MsoNormal>For all drivers</p>
  </td>
  <td style='padding:.75pt .75pt .75pt .75pt'>
  <p class=MsoNormal>'persist', 'persistent', 'debug', 'fetchmode', 'new' </p>
  </td>
 </tr>
 <tr style='mso-yfti-irow:1'>
  <td style='padding:.75pt .75pt .75pt .75pt'>
  <p class=MsoNormal>Interbase/Firebird </p>
  </td>
  <td style='padding:.75pt .75pt .75pt .75pt'>
  <p class=MsoNormal>'dialect','charset','buffers','role' </p>
  </td>
 </tr>
 <tr style='mso-yfti-irow:2'>
  <td style='padding:.75pt .75pt .75pt .75pt'>
  <p class=MsoNormal>M'soft <st1:City w:st="on"><st1:place w:st="on">ADO</st1:place></st1:City></p>
  </td>
  <td style='padding:.75pt .75pt .75pt .75pt'>
  <p class=MsoNormal>'charpage' </p>
  </td>
 </tr>
 <tr style='mso-yfti-irow:3'>
  <td style='padding:.75pt .75pt .75pt .75pt'>
  <p class=MsoNormal>MySQL</p>
  </td>
  <td style='padding:.75pt .75pt .75pt .75pt'>
  <p class=MsoNormal>'clientflags' </p>
  </td>
 </tr>
 <tr style='mso-yfti-irow:4'>
  <td style='padding:.75pt .75pt .75pt .75pt'>
  <p class=MsoNormal>MySQLi</p>
  </td>
  <td style='padding:.75pt .75pt .75pt .75pt'>
  <p class=MsoNormal>'port', 'socket', 'clientflags' </p>
  </td>
 </tr>
 <tr style='mso-yfti-irow:5;mso-yfti-lastrow:yes'>
  <td style='padding:.75pt .75pt .75pt .75pt'>
  <p class=MsoNormal>Oci8</p>
  </td>
  <td style='padding:.75pt .75pt .75pt .75pt'>
  <p class=MsoNormal>'nls_date_format','charset' </p>
  </td>
 </tr>
</table>

</div>

<p>For all drivers, when the options <i>persist</i> or <i>persistent</i> are
set, a persistent connection is forced; similarly, when <i>new</i> is set, then
a new connection will be created using NConnect if the underlying driver
supports it. The <i>debug</i> option enables debugging. The <i>fetchmode</i>
calls <a href="#setfetchmode">SetFetchMode()</a>. If no value is defined for an
option, then the value is set to 1. </p>

<p>ADOdb DSN's are compatible with version 1.0 of PEAR DB's DSN format. <a
name="connect_ex"></a></p>

<h3><span style='mso-bookmark:connect_ex'>Examples of Connecting to Databases</span></h3>

<h4><span style='mso-bookmark:connect_ex'>MySQL and Most Other Database Drivers</span></h4>

<p><span style='mso-bookmark:connect_ex'>MySQL connections are very
straightforward, and the parameters are identical to mysql_connect:</span></p>

<div style='mso-element:para-border-div;border:solid #DDDDDD 1.0pt;mso-border-alt:
solid #DDDDDD .75pt;padding:9.0pt 18.0pt 9.0pt 18.0pt;background:#EEEEEE'><pre><span
style='mso-bookmark:connect_ex'><span style='mso-tab-count:1'>         </span>$conn = &amp;ADONewConnection('mysql'); <br>
<span style='mso-tab-count:1'>         </span>$conn-&gt;PConnect('localhost','userid','password','database');<br>
<span style='mso-tab-count:1'>         </span><br>
<span style='mso-tab-count:1'>         </span></span><span style='mso-bookmark:
connect_ex'><span style='color:green'># or dsn </span></span></pre><pre><span
style='mso-bookmark:connect_ex'><span style='mso-tab-count:1'>         </span>$dsn = 'mysql://user:hide@address.com/mydb'; </span></pre><pre><span
style='mso-bookmark:connect_ex'><span style='mso-tab-count:1'>         </span>$conn = ADONewConnection($dsn);<span style='mso-spacerun:yes'>  </span># no need for Connect()</span></pre><pre><span
style='mso-bookmark:connect_ex'><span style='mso-tab-count:1'>         </span></span></pre><pre><span
style='mso-bookmark:connect_ex'><span style='mso-tab-count:1'>         </span></span><span
style='mso-bookmark:connect_ex'><span style='color:green'># or persistent dsn</span></span></pre><pre><span
style='mso-bookmark:connect_ex'><span style='mso-tab-count:1'>         </span>$dsn = 'mysql://user:hide@address.com/mydb?persist'; </span></pre><pre><span
style='mso-bookmark:connect_ex'><span style='mso-tab-count:1'>         </span>$conn = ADONewConnection($dsn);<span style='mso-spacerun:yes'>  </span># no need for PConnect()</span></pre><pre><span
style='mso-bookmark:connect_ex'><span style='mso-tab-count:1'>         </span></span></pre><pre><span
style='mso-bookmark:connect_ex'><span style='mso-tab-count:1'>         </span></span><span
style='mso-bookmark:connect_ex'><span style='color:green'># a more complex example:</span></span></pre><pre><span
style='mso-bookmark:connect_ex'><span style='mso-tab-count:1'>         </span>$pwd = urlencode($pwd);</span></pre><pre><span
style='mso-bookmark:connect_ex'><span style='mso-tab-count:1'>         </span>$flags =<span style='mso-spacerun:yes'>  </span>MYSQL_CLIENT_COMPRESS;</span></pre><pre><span
style='mso-bookmark:connect_ex'><span style='mso-tab-count:1'>         </span>$dsn = &quot;mysql://user:$hide@address.com/mydb?persist&amp;clientflags=$flags&quot;;</span></pre><pre><span
style='mso-bookmark:connect_ex'><span style='mso-tab-count:1'>         </span>$conn = ADONewConnection($dsn);<span style='mso-spacerun:yes'>  </span># no need for PConnect()</span></pre><pre
style='background:#EEEEEE'><span style='mso-bookmark:connect_ex'> </span></pre></div>

<p><span style='mso-bookmark:connect_ex'>For most drivers, you can use the
standard function: Connect($server, $user, $password, $database), or a </span><a
href="dsnsupport">DSN</a> since ADOdb 4.51. Exceptions to this are listed
below. </p>

<h4><a name=pdo>PDO</a></h4>

<p><span style='mso-bookmark:pdo'>PDO, which only works with PHP5, accepts a
driver specific connection string: </span></p>

<div style='mso-element:para-border-div;border:solid #DDDDDD 1.0pt;mso-border-alt:
solid #DDDDDD .75pt;padding:9.0pt 18.0pt 9.0pt 18.0pt;background:#EEEEEE'><pre><span
style='mso-bookmark:pdo'><o:p>&nbsp;</o:p></span></pre><pre><span
style='mso-bookmark:pdo'><span style='mso-tab-count:1'>         </span>$conn =&amp; NewADConnection('pdo');</span></pre><pre><span
style='mso-bookmark:pdo'><span style='mso-tab-count:1'>         </span>$conn-&gt;Connect('mysql:host=localhost',$user,$pwd,$mydb);</span></pre><pre><span
style='mso-bookmark:pdo'><span style='mso-tab-count:1'>         </span>$conn-&gt;Connect('mysql:host=localhost;dbname=mydb',$user,$pwd);</span></pre><pre><span
style='mso-bookmark:pdo'><span style='mso-tab-count:1'>         </span>$conn-&gt;Connect(&quot;mysql:host=localhost;dbname=mydb;username=$user;password=$pwd&quot;);</span></pre></div>

<p><span style='mso-bookmark:pdo'>The DSN mechanism is also supported: </span></p>

<div style='mso-element:para-border-div;border:solid #DDDDDD 1.0pt;mso-border-alt:
solid #DDDDDD .75pt;padding:9.0pt 18.0pt 9.0pt 18.0pt;background:#EEEEEE'><pre><span
style='mso-bookmark:pdo'><o:p>&nbsp;</o:p></span></pre><pre><span
style='mso-bookmark:pdo'><span style='mso-tab-count:1'>         </span>$conn =&amp; NewADConnection(&quot;pdo_mysql://user:hide@address.com/mydb?persist&quot;); # persist is optional</span></pre></div>

<h4><span style='mso-bookmark:pdo'>PostgreSQL</span></h4>

<p><span style='mso-bookmark:pdo'>PostgreSQL 7 and 8 accepts connections using:
</span></p>

<p><span style='mso-bookmark:pdo'>a. the standard connection string:</span></p>

<div style='mso-element:para-border-div;border:solid #DDDDDD 1.0pt;mso-border-alt:
solid #DDDDDD .75pt;padding:9.0pt 18.0pt 9.0pt 18.0pt;background:#EEEEEE'><pre
style='background:#EEEEEE'><span style='mso-bookmark:pdo'><span
style='mso-tab-count:1'>         </span>$conn = &amp;ADONewConnection('postgres');<span style='mso-spacerun:yes'>  </span><br>
<span style='mso-tab-count:1'>         </span>$conn-&gt;PConnect('host=localhost port=5432 dbname=mary');</span></pre></div>

<p><span style='mso-bookmark:pdo'>b. the classical 4 parameters:</span></p>

<div style='mso-element:para-border-div;border:solid #DDDDDD 1.0pt;mso-border-alt:
solid #DDDDDD .75pt;padding:9.0pt 18.0pt 9.0pt 18.0pt;background:#EEEEEE'><pre
style='background:#EEEEEE'><span style='mso-bookmark:pdo'><span
style='mso-tab-count:1'>         </span>$conn-&gt;PConnect('localhost','userid','password','database');<br>
<span style='mso-spacerun:yes'> </span></span></pre></div>

<p><span style='mso-bookmark:pdo'>c. dsn: </span></p>

<div style='mso-element:para-border-div;border:solid #DDDDDD 1.0pt;mso-border-alt:
solid #DDDDDD .75pt;padding:9.0pt 18.0pt 9.0pt 18.0pt;background:#EEEEEE'><pre><span
style='mso-bookmark:pdo'><span style='mso-tab-count:1'>         </span>$dsn = 'postgres://user:hide@address.com/mydb?persist';<span style='mso-spacerun:yes'>  </span># persist is optional</span></pre><pre
style='background:#EEEEEE'><span style='mso-bookmark:pdo'><span
style='mso-tab-count:1'>         </span>$conn = ADONewConnection($dsn);<span style='mso-spacerun:yes'>  </span># no need for Connect/PConnect</span></pre></div>

<span style='mso-bookmark:pdo'></span>

<h4><a name=ldap></a>LDAP</h4>

<p>Here is an example of querying a LDAP server. Thanks to Josh Eldridge for
the driver and this example: </p>

<div style='mso-element:para-border-div;border:solid #DDDDDD 1.0pt;mso-border-alt:
solid #DDDDDD .75pt;padding:9.0pt 18.0pt 9.0pt 18.0pt;background:#EEEEEE'><pre><o:p>&nbsp;</o:p></pre><pre>require('/path/to/adodb.inc.php');</pre><pre><o:p>&nbsp;</o:p></pre><pre>/* Make sure to set this BEFORE calling Connect() */</pre><pre>$LDAP_CONNECT_OPTIONS = Array(</pre><pre><span
style='mso-tab-count:1'>         </span>Array (&quot;OPTION_NAME&quot;=&gt;LDAP_OPT_DEREF, &quot;OPTION_VALUE&quot;=&gt;2),</pre><pre><span
style='mso-tab-count:1'>         </span>Array (&quot;OPTION_NAME&quot;=&gt;LDAP_OPT_SIZELIMIT,&quot;OPTION_VALUE&quot;=&gt;100),</pre><pre><span
style='mso-tab-count:1'>         </span>Array (&quot;OPTION_NAME&quot;=&gt;LDAP_OPT_TIMELIMIT,&quot;OPTION_VALUE&quot;=&gt;30),</pre><pre><span
style='mso-tab-count:1'>         </span>Array (&quot;OPTION_NAME&quot;=&gt;LDAP_OPT_PROTOCOL_VERSION,&quot;OPTION_VALUE&quot;=&gt;3),</pre><pre><span
style='mso-tab-count:1'>         </span>Array (&quot;OPTION_NAME&quot;=&gt;LDAP_OPT_ERROR_NUMBER,&quot;OPTION_VALUE&quot;=&gt;13),</pre><pre><span
style='mso-tab-count:1'>         </span>Array (&quot;OPTION_NAME&quot;=&gt;LDAP_OPT_REFERRALS,&quot;OPTION_VALUE&quot;=&gt;FALSE),</pre><pre><span
style='mso-tab-count:1'>         </span>Array (&quot;OPTION_NAME&quot;=&gt;LDAP_OPT_RESTART,&quot;OPTION_VALUE&quot;=&gt;FALSE)</pre><pre>);</pre><pre>$host = 'ldap.baylor.edu';</pre><pre>$ldapbase = 'ou=People,o=<st1:place
w:st="on"><st1:PlaceName w:st="on">Baylor</st1:PlaceName> <st1:PlaceType w:st="on">University</st1:PlaceType></st1:place>,c=US';</pre><pre><o:p>&nbsp;</o:p></pre><pre>$ldap = NewADOConnection( 'ldap' );</pre><pre>$ldap-&gt;Connect( $host, $user_name='', $password='', $ldapbase );</pre><pre><o:p>&nbsp;</o:p></pre><pre>echo &quot;&lt;pre&gt;&quot;;</pre><pre><o:p>&nbsp;</o:p></pre><pre>print_r( $ldap-&gt;ServerInfo() );</pre><pre>$ldap-&gt;SetFetchMode(ADODB_FETCH_ASSOC);</pre><pre>$userName = 'eldridge';</pre><pre>$filter=&quot;(|(CN=$userName*)(sn=$userName*)(givenname=$userName*)(uid=$userName*))&quot;;</pre><pre><o:p>&nbsp;</o:p></pre><pre>$rs = $ldap-&gt;Execute( $filter );</pre><pre>if ($rs)</pre><pre><span
style='mso-tab-count:1'>         </span>while ($arr = $rs-&gt;FetchRow()) {</pre><pre><span
style='mso-tab-count:1'>         </span><span style='mso-spacerun:yes'>     </span>print_r($arr);<span
style='mso-tab-count:1'>       </span></pre><pre><span style='mso-tab-count:
1'>         </span>}</pre><pre><o:p>&nbsp;</o:p></pre><pre>$rs = $ldap-&gt;Execute( $filter );</pre><pre>if ($rs) </pre><pre><span
style='mso-tab-count:1'>         </span>while (!$rs-&gt;EOF) {</pre><pre> <span
style='mso-tab-count:2'>                </span>print_r($rs-&gt;fields);<span
style='mso-tab-count:1'>     </span></pre><pre><span style='mso-tab-count:2'>                 </span>$rs-&gt;MoveNext();</pre><pre><span
style='mso-tab-count:1'>         </span>} </pre><pre><span style='mso-tab-count:
1'>         </span></pre><pre>print_r( $ldap-&gt;GetArray( $filter ) );</pre><pre>print_r( $ldap-&gt;GetRow( $filter ) );</pre><pre><o:p>&nbsp;</o:p></pre><pre>$ldap-&gt;Close();</pre><pre>echo &quot;&lt;/pre&gt;&quot;;</pre></div>

<p>Using DSN: </p>

<div style='mso-element:para-border-div;border:solid #DDDDDD 1.0pt;mso-border-alt:
solid #DDDDDD .75pt;padding:9.0pt 18.0pt 9.0pt 18.0pt;background:#EEEEEE'><pre><o:p>&nbsp;</o:p></pre><pre>$dsn = &quot;ldap://ldap.baylor.edu/ou=People,o=<st1:place
w:st="on"><st1:PlaceName w:st="on">Baylor</st1:PlaceName> <st1:PlaceType w:st="on">University</st1:PlaceType></st1:place>,c=US&quot;;</pre><pre>$db = NewADOConnection($dsn);</pre></div>

<h4>Interbase/Firebird</h4>

<p class=MsoNormal>You define the database in the $host parameter: </p>

<div style='mso-element:para-border-div;border:solid #DDDDDD 1.0pt;mso-border-alt:
solid #DDDDDD .75pt;padding:9.0pt 18.0pt 9.0pt 18.0pt;background:#EEEEEE'><pre
style='background:#EEEEEE'><span style='mso-tab-count:1'>         </span>$conn = &amp;ADONewConnection('ibase'); <br>
<span style='mso-tab-count:1'>         </span>$conn-&gt;PConnect('localhost:c:\ibase\employee.gdb','sysdba','masterkey');</pre></div>

<p>Or dsn: </p>

<div style='mso-element:para-border-div;border:solid #DDDDDD 1.0pt;mso-border-alt:
solid #DDDDDD .75pt;padding:9.0pt 18.0pt 9.0pt 18.0pt;background:#EEEEEE'><pre
style='background:#EEEEEE'><span style='mso-tab-count:1'>         </span>$dsn = 'firebird://user:hide@address.com/mydb?persist&amp;dialect=3';<span style='mso-spacerun:yes'>  </span># persist is optional<br>
<span style='mso-tab-count:1'>         </span>$conn = ADONewConnection($dsn);<span style='mso-spacerun:yes'>  </span># no need for Connect/PConnect</pre></div>

<h4>SQLite</h4>

<p class=MsoNormal>Sqlite will create the database file if it does not exist. </p>

<div style='mso-element:para-border-div;border:solid #DDDDDD 1.0pt;mso-border-alt:
solid #DDDDDD .75pt;padding:9.0pt 18.0pt 9.0pt 18.0pt;background:#EEEEEE'><pre><span
style='mso-tab-count:1'>         </span>$conn = &amp;ADONewConnection('sqlite');</pre><pre
style='background:#EEEEEE'><span style='mso-tab-count:1'>         </span>$conn-&gt;PConnect('c:\path\to\sqlite.db'); # sqlite will create if does not exist</pre></div>

<p>Or dsn: </p>

<div style='mso-element:para-border-div;border:solid #DDDDDD 1.0pt;mso-border-alt:
solid #DDDDDD .75pt;padding:9.0pt 18.0pt 9.0pt 18.0pt;background:#EEEEEE'><pre><span
style='mso-tab-count:1'>         </span>$path = urlencode('c:\path\to\sqlite.db');</pre><pre><span
style='mso-tab-count:1'>         </span>$dsn = &quot;sqlite://$path/?persist&quot;;<span style='mso-spacerun:yes'>  </span># persist is optional</pre><pre
style='background:#EEEEEE'><span style='mso-tab-count:1'>         </span>$conn = ADONewConnection($dsn);<span style='mso-spacerun:yes'>  </span># no need for Connect/PConnect</pre></div>

<h4>Oracle (oci8)</h4>

<p>With oci8, you can connect in multiple ways. Note that oci8 works fine with
newer versions of the Oracle, eg. 9i and 10g.</p>

<p>a. PHP and Oracle reside on the same machine, use default SID.</p>

<div style='mso-element:para-border-div;border:solid #DDDDDD 1.0pt;mso-border-alt:
solid #DDDDDD .75pt;padding:9.0pt 18.0pt 9.0pt 18.0pt;background:#EEEEEE'><pre
style='background:#EEEEEE'><span style='mso-tab-count:1'>         </span>$conn-&gt;Connect(false, 'scott', 'tiger');</pre></div>

<p>b. TNS Name defined in tnsnames.ora (or ONAMES or HOSTNAMES), eg. 'myTNS'</p>

<div style='mso-element:para-border-div;border:solid #DDDDDD 1.0pt;mso-border-alt:
solid #DDDDDD .75pt;padding:9.0pt 18.0pt 9.0pt 18.0pt;background:#EEEEEE'><pre
style='background:#EEEEEE'><span style='mso-tab-count:1'>         </span>$conn-&gt;PConnect(false, 'scott', 'tiger', 'myTNS');</pre></div>

<p>or</p>

<div style='mso-element:para-border-div;border:solid #DDDDDD 1.0pt;mso-border-alt:
solid #DDDDDD .75pt;padding:9.0pt 18.0pt 9.0pt 18.0pt;background:#EEEEEE'><pre
style='background:#EEEEEE'><span style='mso-spacerun:yes'> </span><span
style='mso-tab-count:1'>        </span>$conn-&gt;PConnect('myTNS', 'scott', 'tiger');</pre></div>

<p>c. Host Address and SID</p>

<div style='mso-element:para-border-div;border:solid #DDDDDD 1.0pt;mso-border-alt:
solid #DDDDDD .75pt;padding:9.0pt 18.0pt 9.0pt 18.0pt;background:#EEEEEE'><pre><o:p>&nbsp;</o:p></pre><pre><span
style='mso-tab-count:1'>         </span># with adodb 5.06 or 4.991 and later</pre><pre><span
style='mso-tab-count:1'>         </span>$conn-&gt;Connect('192.168.0.1', 'scott', 'tiger', &quot;SID=$SID&quot;);</pre><pre><span
style='mso-tab-count:1'>         </span></pre><pre><span style='mso-tab-count:
1'>         </span># OR with all versions of ADOdb</pre><pre><span
style='mso-tab-count:1'>         </span>$conn-&gt;connectSID = true;</pre><pre><span
style='mso-tab-count:1'>         </span>$conn-&gt;Connect('192.168.0.1', 'scott', 'tiger', $SID);</pre><pre
style='background:#EEEEEE'><span style='mso-tab-count:1'>         </span></pre></div>

<p>d. Host Address and Service Name</p>

<div style='mso-element:para-border-div;border:solid #DDDDDD 1.0pt;mso-border-alt:
solid #DDDDDD .75pt;padding:9.0pt 18.0pt 9.0pt 18.0pt;background:#EEEEEE'><pre
style='background:#EEEEEE'><span style='mso-tab-count:1'>         </span>$conn-&gt;Connect('192.168.0.1', 'scott', 'tiger', 'servicename');</pre></div>

<p>e. Oracle connection string: </p>

<div style='mso-element:para-border-div;border:solid #DDDDDD 1.0pt;mso-border-alt:
solid #DDDDDD .75pt;padding:9.0pt 18.0pt 9.0pt 18.0pt;background:#EEEEEE'><pre
style='background:#EEEEEE'><span style='mso-tab-count:1'>         </span>$cstr = &quot;(DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=$host)(PORT=$port))<br>
<span style='mso-tab-count:3'>                          </span>(CONNECT_DATA=(SID=$sid)))&quot;;<br>
<span style='mso-tab-count:1'>         </span>$conn-&gt;Connect($cstr, 'scott', 'tiger');</pre></div>

<p>f. ADOdb dsn: </p>

<div style='mso-element:para-border-div;border:solid #DDDDDD 1.0pt;mso-border-alt:
solid #DDDDDD .75pt;padding:9.0pt 18.0pt 9.0pt 18.0pt;background:#EEEEEE'><pre
style='background:#EEEEEE'><span style='mso-tab-count:1'>         </span>$dsn = 'oci8://user:hide@address.com/?persist';<span style='mso-spacerun:yes'>  </span># persist is optional<br>
<span style='mso-tab-count:1'>         </span>$conn = ADONewConnection($dsn);<span style='mso-spacerun:yes'>  </span># no need for Connect/PConnect<br>
<span style='mso-tab-count:1'>         </span><br>
<span style='mso-tab-count:1'>         </span>$dsn = 'oci8://user:hide@address.com/sid';<br>
<span style='mso-tab-count:1'>         </span>$conn = ADONewConnection($dsn);<br>
<span style='mso-tab-count:1'>         </span><br>
<span style='mso-tab-count:1'>         </span>$dsn = 'oci8://user:pwd@/';<span style='mso-spacerun:yes'>   </span># oracle on local machine<br>
<span style='mso-tab-count:1'>         </span>$conn = ADONewConnection($dsn);</pre></div>

<p>You can also set the charSet for Oracle 9.2 and later, supported since PHP
4.3.2, ADOdb 4.54: </p>

<div style='mso-element:para-border-div;border:solid #DDDDDD 1.0pt;mso-border-alt:
solid #DDDDDD .75pt;padding:9.0pt 18.0pt 9.0pt 18.0pt;background:#EEEEEE'><pre
style='background:#EEEEEE'><span style='mso-tab-count:1'>         </span>$conn-&gt;charSet = 'we8iso8859p1';<br>
<span style='mso-tab-count:1'>         </span>$conn-&gt;Connect(...);<br>
<span style='mso-tab-count:1'>         </span><br>
<span style='mso-tab-count:1'>         </span># or<br>
<span style='mso-tab-count:1'>         </span>$dsn = 'oci8://user:hide@address.com/?charset=WE8MSWIN1252';<br>
<span style='mso-tab-count:1'>         </span>$db = ADONewConnection($dsn);</pre></div>

<h4><a name=dsnless></a>DSN-less ODBC ( Access, MSSQL and DB2 examples)</h4>

<p>ODBC DSN's can be created in the ODBC control panel, or you can use a
DSN-less connection.To use DSN-less connections with ODBC you need PHP 4.3 or
later. </p>

<p>For Microsoft Access:</p>

<div style='mso-element:para-border-div;border:solid #DDDDDD 1.0pt;mso-border-alt:
solid #DDDDDD .75pt;padding:9.0pt 18.0pt 9.0pt 18.0pt;background:#EEEEEE'><pre><span
style='mso-tab-count:1'>         </span>$db =&amp; ADONewConnection('access');<br>
<span style='mso-tab-count:1'>         </span>$dsn = <strong><span
style='font-family:"Courier New"'>&quot;Driver={Microsoft Access Driver (*.mdb)};Dbq=d:\\northwind.mdb;Uid=Admin;Pwd=;&quot;;</span></strong></pre><pre><span
style='mso-tab-count:1'>         </span>$db-&gt;Connect($dsn);</pre></div>

<p class=MsoNormal>For Microsoft SQL Server: </p>

<div style='mso-element:para-border-div;border:solid #DDDDDD 1.0pt;mso-border-alt:
solid #DDDDDD .75pt;padding:9.0pt 18.0pt 9.0pt 18.0pt;background:#EEEEEE'><pre
style='background:#EEEEEE'><span style='mso-tab-count:1'>         </span>$db =&amp; ADONewConnection('odbc_mssql');<br>
<span style='mso-tab-count:1'>         </span>$dsn = <strong><span
style='font-family:"Courier New"'>&quot;Driver={SQL Server};Server=localhost;Database=northwind;&quot;</span></strong>;<br>
<span style='mso-tab-count:1'>         </span>$db-&gt;Connect($dsn,'userid','password');</pre></div>

<p class=MsoNormal>or if you prefer to use the mssql extension (which is
limited to mssql 6.5 functionality): </p>

<div style='mso-element:para-border-div;border:solid #DDDDDD 1.0pt;mso-border-alt:
solid #DDDDDD .75pt;padding:9.0pt 18.0pt 9.0pt 18.0pt;background:#EEEEEE'><pre
style='background:#EEEEEE'><span style='mso-tab-count:1'>         </span>$db =&amp; ADONewConnection('mssql');<br>
<span style='mso-tab-count:1'>         </span>$db-&gt;Execute('localhost', 'userid', 'password', 'northwind');</pre></div>

<p class=MsoNormal>For DB2: </p>

<div style='mso-element:para-border-div;border:solid #DDDDDD 1.0pt;mso-border-alt:
solid #DDDDDD .75pt;padding:9.0pt 18.0pt 9.0pt 18.0pt;background:#EEEEEE'><pre><o:p>&nbsp;</o:p></pre><pre><span
style='mso-tab-count:1'>         </span>$dbms = 'db2'; # or 'odbc_db2' if db2 extension not available</pre><pre><span
style='mso-tab-count:1'>         </span>$db =&amp; ADONewConnection($dbms);</pre><pre><span
style='mso-tab-count:1'>         </span>$dsn = &quot;driver={IBM db2 odbc DRIVER};Database=sample;hostname=localhost;port=50000;protocol=TCPIP;&quot;.</pre><pre><span
style='mso-tab-count:4'>                                   </span>&quot;uid=root; pwd=secret&quot;;<br>
<span style='mso-tab-count:1'>         </span>$db-&gt;Connect($dsn);</pre></div>

<p class=MsoNormal><b>DSN-less Connections with <st1:City w:st="on">ADO</st1:City></b><br>
If you are using versions of PHP earlier than PHP 4.3.0, DSN-less connections
only work with Microsoft's <st1:City w:st="on"><st1:place w:st="on">ADO</st1:place></st1:City>,
which is Microsoft's COM based API. An example using the ADOdb library and
Microsoft's <st1:City w:st="on"><st1:place w:st="on">ADO</st1:place></st1:City>:
</p>

<div style='mso-element:para-border-div;border:solid #DDDDDD 1.0pt;mso-border-alt:
solid #DDDDDD .75pt;padding:9.0pt 18.0pt 9.0pt 18.0pt;background:#EEEEEE'><pre>&lt;?php<br>
<span style='mso-tab-count:1'>         </span>include('adodb.inc.php'); <br>
<span style='mso-tab-count:1'>         </span>$db = &amp;ADONewConnection(&quot;ado_mssql&quot;);<br>
<span style='mso-tab-count:1'>         </span>print &quot;&lt;h1&gt;Connecting DSN-less $db-&gt;databaseType...&lt;/h1&gt;&quot;;<br>
<span style='mso-tab-count:2'>                 </span><br>
<span style='mso-tab-count:1'>         </span><b>$myDSN=&quot;PROVIDER=MSDASQL;DRIVER={SQL Server};&quot;<br>
<span style='mso-tab-count:2'>                 </span>. &quot;SERVER=flipper;DATABASE=ai;UID=sa;PWD=;&quot;<span style='mso-spacerun:yes'>  </span>;</b></pre><pre><span
style='mso-tab-count:1'>         </span>$db-&gt;Connect($myDSN);</pre><pre><span
style='mso-tab-count:1'>         </span></pre><pre><span style='mso-tab-count:
1'>         </span>$rs = $db-&gt;Execute(&quot;select * from table&quot;);</pre><pre><span
style='mso-tab-count:1'>         </span>$arr = $rs-&gt;GetArray();</pre><pre><span
style='mso-tab-count:1'>         </span>print_r($arr);</pre><pre>?&gt;</pre></div>

<h2><a name=speed></a>High Speed ADOdb - tuning tips</h2>

<p>ADOdb is a big class library, yet it <a href="http://phplens.com/lens/adodb/">consistently
beats</a> all other PHP class libraries in performance. This is because it is
designed in a layered fashion, like an onion, with the fastest functions in the
innermost layer. Stick to the following functions for best performance:</p>

<div align=center>

<table class=MsoNormalTable border=1 cellpadding=0 width="40%"
 style='width:40.0%;mso-cellspacing:1.5pt'>
 <tr style='mso-yfti-irow:0;mso-yfti-firstrow:yes'>
  <td style='padding:.75pt .75pt .75pt .75pt'>
  <p class=MsoNormal align=center style='text-align:center'><b>Innermost Layer</b></p>
  </td>
 </tr>
 <tr style='mso-yfti-irow:1;mso-yfti-lastrow:yes'>
  <td style='padding:.75pt .75pt .75pt .75pt'>
  <p align=center style='text-align:center'>Connect, PConnect, NConnect<br>
  Execute, CacheExecute<br>
  SelectLimit, CacheSelectLimit<br>
  MoveNext, Close <br>
  qstr, Affected_Rows, Insert_ID</p>
  </td>
 </tr>
</table>

</div>

<p>The fastest way to access the field data is by accessing the array
$recordset-&gt;fields directly. Also set the global variables <a
href="#adodb_fetch_mode">$ADODB_FETCH_MODE</a> = ADODB_FETCH_NUM, and (for
oci8, ibase/firebird and odbc) <a href="#adodb_countrecs">$ADODB_COUNTRECS</a>
= false before you connect to your database.</p>

<p>Consider using bind parameters if your database supports it, as it improves
query plan reuse. Use ADOdb's performance tuning system to identify bottlenecks
quickly. At the time of writing (Dec 2003), this means oci8 and odbc drivers.</p>

<p>Lastly make sure you have a PHP accelerator cache installed such as APC,
Turck MMCache, Zend Accelerator or ionCube.</p>

<p>Some examples:</p>

<div align=center>

<table class=MsoNormalTable border=1 cellpadding=0 style='mso-cellspacing:1.5pt'>
 <tr style='mso-yfti-irow:0;mso-yfti-firstrow:yes'>
  <td style='padding:.75pt .75pt .75pt .75pt'>
  <p class=MsoNormal><b>Fastest data retrieval using PHP</b></p>
  </td>
  <td style='padding:.75pt .75pt .75pt .75pt'>
  <p class=MsoNormal><b>Fastest data retrieval using ADOdb extension</b></p>
  </td>
 </tr>
 <tr style='mso-yfti-irow:1;mso-yfti-lastrow:yes'>
  <td style='padding:.75pt .75pt .75pt .75pt'>
  <div style='mso-element:para-border-div;border:solid #DDDDDD 1.0pt;
  mso-border-alt:solid #DDDDDD .75pt;padding:9.0pt 18.0pt 9.0pt 18.0pt;
  background:#EEEEEE'><pre style='background:#EEEEEE'>$rs =&amp; $rs-&gt;Execute($sql);<br>
while (!$rs-&gt;EOF) {<br>
  <span style='mso-tab-count:1'>         </span>var_dump($rs-&gt;fields);<br>
  <span style='mso-tab-count:1'>         </span>$rs-&gt;MoveNext();<br>
}</pre></div>
  </td>
  <td style='padding:.75pt .75pt .75pt .75pt'>
  <div style='mso-element:para-border-div;border:solid #DDDDDD 1.0pt;
  mso-border-alt:solid #DDDDDD .75pt;padding:9.0pt 18.0pt 9.0pt 18.0pt;
  background:#EEEEEE'><pre style='margin-bottom:12.0pt;background:#EEEEEE'>$rs =&amp; $rs-&gt;Execute($sql);<br>
$array = adodb_getall($rs);<br>
var_dump($array);<br style='mso-special-character:line-break'>
  <![if !supportLineBreakNewLine]><br style='mso-special-character:line-break'>
  <![endif]></pre></div>
  </td>
 </tr>
</table>

</div>

<p><b>Advanced Tips</b> </p>

<p>If you have the <a href="http://adodb.sourceforge.net/#extension">ADOdb C
extension</a> installed, you can replace your calls to $rs-&gt;MoveNext() with
adodb_movenext($rs). This doubles the speed of this operation. For retrieving
entire recordsets at once, use GetArray(), which uses the high speed extension
function adodb_getall($rs) internally. </p>

<p>Execute() is the default way to run queries. You can use the low-level
functions _Execute() and _query() to reduce query overhead. Both these
functions share the same parameters as Execute(). </p>

<p>If you do not have any bind parameters or your database supports binding
(without emulation), then you can call _Execute() directly. Calling this
function bypasses bind emulation. Debugging is still supported in _Execute(). </p>

<p>If you do not require debugging facilities nor emulated binding, and do not
require a recordset to be returned, then you can call _query. This is great for
inserts, updates and deletes. Calling this function bypasses emulated binding,
debugging, and recordset handling. Either the resultid, true or false are
returned by _query(). </p>

<p>For Informix, you can disable scrollable cursors with $db-&gt;cursorType =
0. </p>

<h2><a name=hack></a>Hacking ADOdb Safely</h2>

<p>You might want to modify ADOdb for your own purposes. Luckily you can still
maintain backward compatibility by sub-classing ADOdb and using the
$ADODB_NEWCONNECTION variable. $ADODB_NEWCONNECTION allows you to override the
behaviour of ADONewConnection(). ADOConnection() checks for this variable and
will call the function-name stored in this variable if it is defined. </p>

<p>In the following example, new functionality for the connection object is
placed in the <i>hack_mysql</i> and <i>hack_postgres7</i> classes. The
recordset class naming convention can be controlled using $rsPrefix. Here we
set it to 'hack_rs_', which will make ADOdb use <i>hack_rs_mysql</i> and <i>hack_rs_postgres7</i>
as the recordset classes. </p>

<div style='mso-element:para-border-div;border:solid #DDDDDD 1.0pt;mso-border-alt:
solid #DDDDDD .75pt;padding:9.0pt 18.0pt 9.0pt 18.0pt;background:#EEEEEE'><pre
style='background:#EEEEEE'>class hack_mysql extends adodb_mysql {<br>
var $rsPrefix = 'hack_rs_';<br>
<span style='mso-spacerun:yes'>  </span>/* Your mods here */<br>
}<br>
<br>
class hack_rs_mysql extends ADORecordSet_mysql {<br>
<span style='mso-tab-count:1'>         </span><span style='mso-spacerun:yes'> </span>/* Your mods here */<br>
}<br>
<br>
class hack_postgres7 extends adodb_postgres7 {<br>
var $rsPrefix = 'hack_rs_';<br>
<span style='mso-spacerun:yes'>  </span>/* Your mods here */<br>
}<br>
<br>
class hack_rs_postgres7 extends ADORecordSet_postgres7 {<br>
<span style='mso-spacerun:yes'> </span>/* Your mods here */<br>
}<br>
<br>
$ADODB_NEWCONNECTION = 'hack_factory';<br>
<br>
function&amp; hack_factory($driver)<br>
{<br>
<span style='mso-tab-count:1'>         </span>if ($driver !== 'mysql' &amp;&amp; $driver !== 'postgres7') return false;<br>
<span style='mso-tab-count:1'>         </span><br>
<span style='mso-tab-count:1'>         </span>$driver = 'hack_'.$driver;<br>
<span style='mso-tab-count:1'>         </span>$obj = new $driver();<br>
<span style='mso-tab-count:1'>         </span>return $obj;<br>
}<br>
<br>
include_once('adodb.inc.php');</pre></div>

<p>Don't forget to call the constructor of the parent class in your
constructor. If you want to use the default ADOdb drivers return false in the
above hack_factory() function. Also you can define your own
ADORecordSet_empty() class, by defining a class $$this-&gt;rsPrefix.'empty'
since 4.96/5.02. <a name=php5></a></p>

<h2>PHP5 Features</h2>

<p class=MsoNormal>ADOdb 4.02 or later will transparently determine which
version of PHP you are using. If PHP5 is detected, the following features become
available: </p>

<ul type=disc>
 <li class=MsoNormal style='mso-margin-top-alt:auto;margin-bottom:12.0pt;
     mso-list:l11 level1 lfo5;tab-stops:list 36.0pt'><b>PDO</b>: PDO drivers
     are available. See the <a href="#pdo">connection examples</a>. Currently
     PDO drivers are not as powerful as native drivers, and should be treated
     as experimental.<a name=php5iterators></a></li>
 <li class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;
     mso-list:l11 level1 lfo5;tab-stops:list 36.0pt'><b>Foreach iterators</b>:
     This is a very natural way of going through a recordset: </li>
</ul>

<div style='mso-element:para-border-div;border:solid #DDDDDD 1.0pt;mso-border-alt:
solid #DDDDDD .75pt;padding:9.0pt 18.0pt 9.0pt 18.0pt;background:#EEEEEE;
margin-left:36.0pt;margin-right:0cm'><pre style='background:#EEEEEE'><span
style='mso-tab-count:1'>  </span>$ADODB_FETCH_MODE = ADODB_FETCH_NUM;<br>
<span style='mso-tab-count:1'>  </span>$rs = $db-&gt;Execute($sql);<br>
<span style='mso-tab-count:1'>  </span>foreach($rs as $k =&gt; $row) {<br>
<span style='mso-tab-count:2'>           </span>echo &quot;r1=&quot;.$row[0].&quot; r2=&quot;.$row[1].&quot;&lt;br&gt;&quot;;<br>
<span style='mso-tab-count:1'>  </span>}</pre></div>

<ul type=disc>
 <li class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;
     mso-list:l11 level1 lfo5;tab-stops:list 36.0pt'><a name=php5exceptions></a><b>Exceptions</b>:
     Just include <i>adodb-exceptions.inc.php</i> and you can now catch
     exceptions on errors as they occur. </li>
</ul>

<div style='mso-element:para-border-div;border:solid #DDDDDD 1.0pt;mso-border-alt:
solid #DDDDDD .75pt;padding:9.0pt 18.0pt 9.0pt 18.0pt;background:#EEEEEE;
margin-left:36.0pt;margin-right:0cm'><pre style='background:#EEEEEE'><span
style='mso-tab-count:1'>  </span><b>include(&quot;../adodb-exceptions.inc.php&quot;);</b> <br>
<span style='mso-tab-count:1'>  </span>include(&quot;../adodb.inc.php&quot;);<span
style='mso-tab-count:1'>       </span> <br>
<span style='mso-tab-count:1'>  </span>try { <br>
<span style='mso-tab-count:2'>           </span>$db = NewADOConnection(&quot;oci8&quot;); <br>
<span style='mso-tab-count:2'>           </span>$db-&gt;Connect('','scott','bad-password'); <br>
<span style='mso-tab-count:1'>  </span>} catch (exception $e) { <br>
<span style='mso-tab-count:2'>           </span>var_dump($e); <br>
<span style='mso-tab-count:2'>           </span>adodb_backtrace($e-&gt;gettrace());<br>
<span style='mso-tab-count:1'>  </span>} </pre></div>

<p style='margin-left:36.0pt'>Note that reaching EOF is <b>not</b> considered
an error nor an exception. </p>

<h3><a name=drivers></a>Databases Supported</h3>

<p class=MsoNormal>The <i>name</i> below is the value you pass to
NewADOConnection($name) to create a connection object for that database. </p>

<table class=MsoNormalTable border=1 cellpadding=0 width="100%"
 style='width:100.0%;mso-cellspacing:1.5pt'>
 <tr style='mso-yfti-irow:0;mso-yfti-firstrow:yes'>
  <td valign=top style='padding:.75pt .75pt .75pt .75pt'>
  <p class=MsoNormal><b>Name</b></p>
  </td>
  <td valign=top style='padding:.75pt .75pt .75pt .75pt'>
  <p class=MsoNormal><b>Tested</b></p>
  </td>
  <td valign=top style='padding:.75pt .75pt .75pt .75pt'>
  <p class=MsoNormal><b>Database</b></p>
  </td>
  <td valign=top style='padding:.75pt .75pt .75pt .75pt'>
  <p class=MsoNormal><b><span style='font-size:10.0pt'>RecordCount() usable</span></b></p>
  </td>
  <td valign=top style='padding:.75pt .75pt .75pt .75pt'>
  <p class=MsoNormal><b>Prerequisites</b></p>
  </td>
  <td valign=top style='padding:.75pt .75pt .75pt .75pt'>
  <p class=MsoNormal><b>Operating Systems</b></p>
  </td>
 </tr>
 <tr style='mso-yfti-irow:1'>
  <td valign=top style='padding:.75pt .75pt .75pt .75pt'>
  <p class=MsoNormal><b><span style='font-size:10.0pt'>access</span></b></p>
  </td>
  <td valign=top style='padding:.75pt .75pt .75pt .75pt'>
  <p class=MsoNormal><span style='font-size:10.0pt'>B</span></p>
  </td>
  <td valign=top style='padding:.75pt .75pt .75pt .75pt'>
  <p class=MsoNormal><span style='font-size:10.0pt'>Microsoft Access/Jet. You
  need to create an ODBC DSN.</span></p>
  </td>
  <td valign=top style='padding:.75pt .75pt .75pt .75pt'>
  <p class=MsoNormal><span style='font-size:10.0pt'>Y/N</span></p>
  </td>
  <td valign=top style='padding:.75pt .75pt .75pt .75pt'>
  <p class=MsoNormal><span style='font-size:10.0pt'>ODBC </span></p>
  </td>
  <td valign=top style='padding:.75pt .75pt .75pt .75pt'>
  <p class=MsoNormal><span style='font-size:10.0pt'>Windows only</span></p>
  </td>
 </tr>
 <tr style='mso-yfti-irow:2'>
  <td valign=top style='padding:.75pt .75pt .75pt .75pt'>
  <p class=MsoNormal><b><span style='font-size:10.0pt'>ado</span></b></p>
  </td>
  <td valign=top style='padding:.75pt .75pt .75pt .75pt'>
  <p class=MsoNormal><span style='font-size:10.0pt'>B</span></p>
  </td>
  <td valign=top style='padding:.75pt .75pt .75pt .75pt'>
  <p><span style='font-size:10.0pt'>Generic <st1:City w:st="on"><st1:place
   w:st="on">ADO</st1:place></st1:City>, not tuned for specific databases.
  Allows DSN-less connections. For best performance, use an OLEDB provider.
  This is the base class for all ado drivers.</span></p>
  <p><span style='font-size:10.0pt'>You can set $db-&gt;codePage before
  connecting.</span></p>
  </td>
  <td valign=top style='padding:.75pt .75pt .75pt .75pt'>
  <p class=MsoNormal><span style='font-size:10.0pt'>? depends on database</span></p>
  </td>
  <td valign=top style='padding:.75pt .75pt .75pt .75pt'>
  <p class=MsoNormal><st1:City w:st="on"><st1:place w:st="on"><span
    style='font-size:10.0pt'>ADO</span></st1:place></st1:City><span
  style='font-size:10.0pt'> or OLEDB provider</span></p>
  </td>
  <td valign=top style='padding:.75pt .75pt .75pt .75pt'>
  <p class=MsoNormal><span style='font-size:10.0pt'>Windows only</span></p>
  </td>
 </tr>
 <tr style='mso-yfti-irow:3'>
  <td valign=top style='padding:.75pt .75pt .75pt .75pt'>
  <p class=MsoNormal><b><span style='font-size:10.0pt'>ado_access</span></b></p>
  </td>
  <td valign=top style='padding:.75pt .75pt .75pt .75pt'>
  <p class=MsoNormal><span style='font-size:10.0pt'>B</span></p>
  </td>
  <td valign=top style='padding:.75pt .75pt .75pt .75pt'>
  <p class=MsoNormal><span style='font-size:10.0pt'>Microsoft Access/Jet using <st1:City
  w:st="on"><st1:place w:st="on">ADO</st1:place></st1:City>. Allows DSN-less
  connections. For best performance, use an OLEDB provider.</span></p>
  </td>
  <td valign=top style='padding:.75pt .75pt .75pt .75pt'>
  <p class=MsoNormal><span style='font-size:10.0pt'>Y/N</span></p>
  </td>
  <td valign=top style='padding:.75pt .75pt .75pt .75pt'>
  <p class=MsoNormal><st1:City w:st="on"><st1:place w:st="on"><span
    style='font-size:10.0pt'>ADO</span></st1:place></st1:City><span
  style='font-size:10.0pt'> or OLEDB provider</span></p>
  </td>
  <td valign=top style='padding:.75pt .75pt .75pt .75pt'>
  <p class=MsoNormal><span style='font-size:10.0pt'>Windows only</span></p>
  </td>
 </tr>
 <tr style='mso-yfti-irow:4'>
  <td valign=top style='padding:.75pt .75pt .75pt .75pt'>
  <p class=MsoNormal><b><span style='font-size:10.0pt'>ado_mssql</span></b></p>
  </td>
  <td valign=top style='padding:.75pt .75pt .75pt .75pt'>
  <p class=MsoNormal><span style='font-size:10.0pt'>B</span></p>
  </td>
  <td valign=top style='padding:.75pt .75pt .75pt .75pt'>
  <p class=MsoNormal><span style='font-size:10.0pt'>Microsoft SQL Server using <st1:City
  w:st="on"><st1:place w:st="on">ADO</st1:place></st1:City>. Allows DSN-less
  connections. For best performance, use an OLEDB provider.</span></p>
  </td>
  <td valign=top style='padding:.75pt .75pt .75pt .75pt'>
  <p class=MsoNormal><span style='font-size:10.0pt'>Y/N</span></p>
  </td>
  <td valign=top style='padding:.75pt .75pt .75pt .75pt'>
  <p class=MsoNormal><st1:City w:st="on"><st1:place w:st="on"><span
    style='font-size:10.0pt'>ADO</span></st1:place></st1:City><span
  style='font-size:10.0pt'> or OLEDB provider</span></p>
  </td>
  <td valign=top style='padding:.75pt .75pt .75pt .75pt'>
  <p class=MsoNormal><span style='font-size:10.0pt'>Windows only</span></p>
  </td>
 </tr>
 <tr style='mso-yfti-irow:5;height:40.5pt'>
  <td valign=top style='padding:.75pt .75pt .75pt .75pt;height:40.5pt'>
  <p class=MsoNormal><b><span style='font-size:10.0pt'>db2</span></b></p>
  </td>
  <td valign=top style='padding:.75pt .75pt .75pt .75pt;height:40.5pt'>
  <p class=MsoNormal><span style='font-size:10.0pt'>C</span></p>
  </td>
  <td valign=top style='padding:.75pt .75pt .75pt .75pt;height:40.5pt'>
  <p class=MsoNormal><span style='font-size:10.0pt'>Uses PHP's db2-specific
  extension for better performance.</span></p>
  </td>
  <td valign=top style='padding:.75pt .75pt .75pt .75pt;height:40.5pt'>
  <p class=MsoNormal><span style='font-size:10.0pt'>Y/N</span></p>
  </td>
  <td valign=top style='padding:.75pt .75pt .75pt .75pt;height:40.5pt'>
  <p class=MsoNormal><span style='font-size:10.0pt'>DB2 CLI/ODBC interface</span></p>
  </td>
  <td valign=top style='padding:.75pt .75pt .75pt .75pt;height:40.5pt'>
  <p><span style='font-size:10.0pt'>Unix and Windows. Requires IBM DB2
  Universal Database client.</span></p>
  </td>
 </tr>
 <tr style='mso-yfti-irow:6;height:40.5pt'>
  <td valign=top style='padding:.75pt .75pt .75pt .75pt;height:40.5pt'>
  <p class=MsoNormal><b><span style='font-size:10.0pt'>odbc_db2</span></b></p>
  </td>
  <td valign=top style='padding:.75pt .75pt .75pt .75pt;height:40.5pt'>
  <p class=MsoNormal><span style='font-size:10.0pt'>C</span></p>
  </td>
  <td valign=top style='padding:.75pt .75pt .75pt .75pt;height:40.5pt'>
  <p class=MsoNormal><span style='font-size:10.0pt'>Connects to DB2 using
  generic ODBC extension.</span></p>
  </td>
  <td valign=top style='padding:.75pt .75pt .75pt .75pt;height:40.5pt'>
  <p class=MsoNormal><span style='font-size:10.0pt'>Y/N</span></p>
  </td>
  <td valign=top style='padding:.75pt .75pt .75pt .75pt;height:40.5pt'>
  <p class=MsoNormal><span style='font-size:10.0pt'>DB2 CLI/ODBC interface</span></p>
  </td>
  <td valign=top style='padding:.75pt .75pt .75pt .75pt;height:40.5pt'>
  <p><span style='font-size:10.0pt'>Unix and Windows. <a
  href="http://www.faqts.com/knowledge_base/view.phtml/aid/6283/fid/14">Unix
  install hints</a>. I have had reports that the $host and $database params
  have to be reversed in Connect() when using the CLI interface.</span></p>
  </td>
 </tr>
 <tr style='mso-yfti-irow:7'>
  <td valign=top style='padding:.75pt .75pt .75pt .75pt'>
  <p class=MsoNormal><b><span style='font-size:10.0pt'>vfp</span></b></p>
  </td>
  <td valign=top style='padding:.75pt .75pt .75pt .75pt'>
  <p class=MsoNormal><span style='font-size:10.0pt'>A</span></p>
  </td>
  <td valign=top style='padding:.75pt .75pt .75pt .75pt'>
  <p class=MsoNormal><span style='font-size:10.0pt'>Microsoft Visual FoxPro.
  You need to create an ODBC DSN.</span></p>
  </td>
  <td valign=top style='padding:.75pt .75pt .75pt .75pt'>
  <p class=MsoNormal><span style='font-size:10.0pt'>Y/N</span></p>
  </td>
  <td valign=top style='padding:.75pt .75pt .75pt .75pt'>
  <p class=MsoNormal><span style='font-size:10.0pt'>ODBC</span></p>
  </td>
  <td valign=top style='padding:.75pt .75pt .75pt .75pt'>
  <p class=MsoNormal><span style='font-size:10.0pt'>Windows only</span></p>
  </td>
 </tr>
 <tr style='mso-yfti-irow:8'>
  <td valign=top style='padding:.75pt .75pt .75pt .75pt'>
  <p class=MsoNormal><b><span style='font-size:10.0pt'>fbsql</span></b></p>
  </td>
  <td valign=top style='padding:.75pt .75pt .75pt .75pt'>
  <p class=MsoNormal><span style='font-size:10.0pt'>C</span></p>
  </td>
  <td valign=top style='padding:.75pt .75pt .75pt .75pt'>
  <p class=MsoNormal><span style='font-size:10.0pt'>FrontBase. </span></p>
  </td>
  <td valign=top style='padding:.75pt .75pt .75pt .75pt'>
  <p class=MsoNormal><span style='font-size:10.0pt'>Y</span></p>
  </td>
  <td valign=top style='padding:.75pt .75pt .75pt .75pt'>
  <p class=MsoNormal><span style='font-size:10.0pt'>?</span></p>
  </td>
  <td valign=top style='padding:.75pt .75pt .75pt .75pt'>
  <p><span style='font-size:10.0pt'>Unix and Windows</span></p>
  </td>
 </tr>
 <tr style='mso-yfti-irow:9'>
  <td valign=top style='padding:.75pt .75pt .75pt .75pt'>
  <p class=MsoNormal><b><span style='font-size:10.0pt'>ibase</span></b></p>
  </td>
  <td valign=top style='padding:.75pt .75pt .75pt .75pt'>
  <p class=MsoNormal><span style='font-size:10.0pt'>B</span></p>
  </td>
  <td valign=top style='padding:.75pt .75pt .75pt .75pt'>
  <p class=MsoNormal><span style='font-size:10.0pt'>Interbase 6 or earlier.
  Some users report you might need to use this<br>
  $db-&gt;PConnect('localhost:c:/ibase/employee.gdb', &quot;sysdba&quot;,
  &quot;masterkey&quot;) to connect. Lacks Affected_Rows currently.<br>
  <br>
  You can set $db-&gt;role, $db-&gt;dialect, $db-&gt;buffers and
  $db-&gt;charSet before connecting.</span></p>
  </td>
  <td valign=top style='padding:.75pt .75pt .75pt .75pt'>
  <p class=MsoNormal><span style='font-size:10.0pt'>Y/N</span></p>
  </td>
  <td valign=top style='padding:.75pt .75pt .75pt .75pt'>
  <p class=MsoNormal><span style='font-size:10.0pt'>Interbase client</span></p>
  </td>
  <td valign=top style='padding:.75pt .75pt .75pt .75pt'>
  <p class=MsoNormal><span style='font-size:10.0pt'>Unix and Windows</span></p>
  </td>
 </tr>
 <tr style='mso-yfti-irow:10'>
  <td valign=top style='padding:.75pt .75pt .75pt .75pt'>
  <p class=MsoNormal><b><i><span style='font-size:10.0pt'>firebird</span></i></b></p>
  </td>
  <td valign=top style='padding:.75pt .75pt .75pt .75pt'>
  <p class=MsoNormal><span style='font-size:10.0pt'>C</span></p>
  </td>
  <td valign=top style='padding:.75pt .75pt .75pt .75pt'>
  <p class=MsoNormal><span style='font-size:10.0pt'>Firebird version of
  interbase.</span></p>
  </td>
  <td valign=top style='padding:.75pt .75pt .75pt .75pt'>
  <p class=MsoNormal><span style='font-size:10.0pt'>Y/N</span></p>
  </td>
  <td valign=top style='padding:.75pt .75pt .75pt .75pt'>
  <p class=MsoNormal><span style='font-size:10.0pt'>Interbase client</span></p>
  </td>
  <td valign=top style='padding:.75pt .75pt .75pt .75pt'>
  <p class=MsoNormal><span style='font-size:10.0pt'>Unix and Windows</span></p>
  </td>
 </tr>
 <tr style='mso-yfti-irow:11'>
  <td valign=top style='padding:.75pt .75pt .75pt .75pt'>
  <p class=MsoNormal><b><i><span style='font-size:10.0pt'>borland_ibase</span></i></b></p>
  </td>
  <td valign=top style='padding:.75pt .75pt .75pt .75pt'>
  <p class=MsoNormal><span style='font-size:10.0pt'>C</span></p>
  </td>
  <td valign=top style='padding:.75pt .75pt .75pt .75pt'>
  <p class=MsoNormal><span style='font-size:10.0pt'>Borland version of
  Interbase 6.5 or later. Very sad that the forks differ.</span></p>
  </td>
  <td valign=top style='padding:.75pt .75pt .75pt .75pt'>
  <p class=MsoNormal><span style='font-size:10.0pt'>Y/N</span></p>
  </td>
  <td valign=top style='padding:.75pt .75pt .75pt .75pt'>
  <p class=MsoNormal><span style='font-size:10.0pt'>Interbase client</span></p>
  </td>
  <td valign=top style='padding:.75pt .75pt .75pt .75pt'>
  <p class=MsoNormal><span style='font-size:10.0pt'>Unix and Windows</span></p>
  </td>
 </tr>
 <tr style='mso-yfti-irow:12'>
  <td valign=top style='padding:.75pt .75pt .75pt .75pt'>
  <p class=MsoNormal><b><span style='font-size:10.0pt'>informix</span></b></p>
  </td>
  <td valign=top style='padding:.75pt .75pt .75pt .75pt'>
  <p class=MsoNormal><span style='font-size:10.0pt'>C</span></p>
  </td>
  <td valign=top style='padding:.75pt .75pt .75pt .75pt'>
  <p class=MsoNormal><span style='font-size:10.0pt'>Generic informix driver.
  Use this if you are using Informix 7.3 or later.</span></p>
  </td>
  <td valign=top style='padding:.75pt .75pt .75pt .75pt'>
  <p class=MsoNormal><span style='font-size:10.0pt'>Y/N</span></p>
  </td>
  <td valign=top style='padding:.75pt .75pt .75pt .75pt'>
  <p class=MsoNormal><span style='font-size:10.0pt'>Informix client</span></p>
  </td>
  <td valign=top style='padding:.75pt .75pt .75pt .75pt'>
  <p class=MsoNormal><span style='font-size:10.0pt'>Unix and Windows</span></p>
  </td>
 </tr>
 <tr style='mso-yfti-irow:13'>
  <td valign=top style='padding:.75pt .75pt .75pt .75pt'>
  <p class=MsoNormal><b><span style='font-size:10.0pt'>informix72</span></b></p>
  </td>
  <td valign=top style='padding:.75pt .75pt .75pt .75pt'>
  <p class=MsoNormal><span style='font-size:10.0pt'>C</span></p>
  </td>
  <td valign=top style='padding:.75pt .75pt .75pt .75pt'>
  <p class=MsoNormal><span style='font-size:10.0pt'>Informix databases before
  Informix 7.3 that do no support SELECT FIRST.</span></p>
  </td>
  <td valign=top style='padding:.75pt .75pt .75pt .75pt'>
  <p class=MsoNormal><span style='font-size:10.0pt'>Y/N</span></p>
  </td>
  <td valign=top style='padding:.75pt .75pt .75pt .75pt'>
  <p class=MsoNormal><span style='font-size:10.0pt'>Informix client</span></p>
  </td>
  <td valign=top style='padding:.75pt .75pt .75pt .75pt'>
  <p class=MsoNormal><span style='font-size:10.0pt'>Unix and Windows</span></p>
  </td>
 </tr>
 <tr style='mso-yfti-irow:14'>
  <td valign=top style='padding:.75pt .75pt .75pt .75pt'>
  <p class=MsoNormal><b><span style='font-size:10.0pt'>ldap</span></b></p>
  </td>
  <td valign=top style='padding:.75pt .75pt .75pt .75pt'>
  <p class=MsoNormal><span style='font-size:10.0pt'>C</span></p>
  </td>
  <td valign=top style='padding:.75pt .75pt .75pt .75pt'>
  <p class=MsoNormal><span style='font-size:10.0pt'>LDAP driver. See this
  example for usage information.</span></p>
  </td>
  <td valign=top style='padding:.75pt .75pt .75pt .75pt'>
  <p class=MsoNormal>&nbsp;</p>
  </td>
  <td valign=top style='padding:.75pt .75pt .75pt .75pt'>
  <p class=MsoNormal><span style='font-size:10.0pt'>LDAP extension</span></p>
  </td>
  <td valign=top style='padding:.75pt .75pt .75pt .75pt'>
  <p class=MsoNormal><span style='font-size:10.0pt'>?</span></p>
  </td>
 </tr>
 <tr style='mso-yfti-irow:15;height:54.75pt'>
  <td valign=top style='padding:.75pt .75pt .75pt .75pt;height:54.75pt'>
  <p class=MsoNormal><b><span style='font-size:10.0pt'>mssql</span></b></p>
  </td>
  <td valign=top style='padding:.75pt .75pt .75pt .75pt;height:54.75pt'>
  <p class=MsoNormal><span style='font-size:10.0pt'>A</span></p>
  </td>
  <td valign=top style='padding:.75pt .75pt .75pt .75pt;height:54.75pt'>
  <p><span style='font-size:10.0pt'>Microsoft SQL Server 7 and later. Works
  with Microsoft SQL Server 2000 also. Note that date formating is problematic
  with this driver. For example, the PHP mssql extension does not return the
  seconds for datetime!</span></p>
  </td>
  <td valign=top style='padding:.75pt .75pt .75pt .75pt;height:54.75pt'>
  <p class=MsoNormal><span style='font-size:10.0pt'>Y/N</span></p>
  </td>
  <td valign=top style='padding:.75pt .75pt .75pt .75pt;height:54.75pt'>
  <p class=MsoNormal><span style='font-size:10.0pt'>Mssql client</span></p>
  </td>
  <td valign=top style='padding:.75pt .75pt .75pt .75pt;height:54.75pt'>
  <p><span style='font-size:10.0pt'>Unix and Windows. <br>
  <a href="http://phpbuilder.com/columns/alberto20000919.php3">Unix install
  howto</a> and <a
  href="http://linuxjournal.com/article.php?sid=6636&amp;mode=thread&amp;order=0">another
  one</a>. </span></p>
  </td>
 </tr>
 <tr style='mso-yfti-irow:16;height:54.75pt'>
  <td valign=top style='padding:.75pt .75pt .75pt .75pt;height:54.75pt'>
  <p class=MsoNormal><b><span style='font-size:10.0pt'>mssqlpo</span></b></p>
  </td>
  <td valign=top style='padding:.75pt .75pt .75pt .75pt;height:54.75pt'>
  <p class=MsoNormal><span style='font-size:10.0pt'>A</span></p>
  </td>
  <td valign=top style='padding:.75pt .75pt .75pt .75pt;height:54.75pt'>
  <p><span style='font-size:10.0pt'>Portable mssql driver. Identical to above mssql
  driver, except that '||', the concatenation operator, is converted to '+'.
  Useful for porting scripts from most other sql variants that use ||.</span></p>
  </td>
  <td valign=top style='padding:.75pt .75pt .75pt .75pt;height:54.75pt'>
  <p class=MsoNormal><span style='font-size:10.0pt'>Y/N</span></p>
  </td>
  <td valign=top style='padding:.75pt .75pt .75pt .75pt;height:54.75pt'>
  <p class=MsoNormal><span style='font-size:10.0pt'>Mssql client</span></p>
  </td>
  <td valign=top style='padding:.75pt .75pt .75pt .75pt;height:54.75pt'>
  <p><span style='font-size:10.0pt'>Unix and Windows. <a
  href="http://phpbuilder.com/columns/alberto20000919.php3"><br>
  Unix install howto</a>.</span></p>
  </td>
 </tr>
 <tr style='mso-yfti-irow:17;height:54.75pt'>
  <td valign=top style='padding:.75pt .75pt .75pt .75pt;height:54.75pt'>
  <p class=MsoNormal><b><span style='font-size:10.0pt'>mssqlnative</span></b></p>
  </td>
  <td valign=top style='padding:.75pt .75pt .75pt .75pt;height:54.75pt'>
  <p class=MsoNormal><span style='font-size:10.0pt'>C</span></p>
  </td>
  <td valign=top style='padding:.75pt .75pt .75pt .75pt;height:54.75pt'>
  <p><span style='font-size:10.0pt'>Native mssql driver from M'soft. </span></p>
  </td>
  <td valign=top style='padding:.75pt .75pt .75pt .75pt;height:54.75pt'>
  <p class=MsoNormal><span style='font-size:10.0pt'>?</span></p>
  </td>
  <td valign=top style='padding:.75pt .75pt .75pt .75pt;height:54.75pt'>
  <p class=MsoNormal><span style='font-size:10.0pt'>?</span></p>
  </td>
  <td valign=top style='padding:.75pt .75pt .75pt .75pt;height:54.75pt'>
  <p><span style='font-size:10.0pt'>Windows. Tq Garrett Serack of M'soft.</span></p>
  </td>
 </tr>
 <tr style='mso-yfti-irow:18'>
  <td style='padding:.75pt .75pt .75pt .75pt'>
  <p class=MsoNormal><o:p>&nbsp;</o:p></p>
  </td>
  <td style='border:none;padding:.75pt .75pt .75pt .75pt'>
  <p class=MsoNormal><span style='font-size:10.0pt;color:windowtext'><o:p>&nbsp;</o:p></span></p>
  </td>
  <td style='border:none;padding:.75pt .75pt .75pt .75pt'>
  <p class=MsoNormal><span style='font-size:10.0pt;color:windowtext'><o:p>&nbsp;</o:p></span></p>
  </td>
  <td style='border:none;padding:.75pt .75pt .75pt .75pt'>
  <p class=MsoNormal><span style='font-size:10.0pt;color:windowtext'><o:p>&nbsp;</o:p></span></p>
  </td>
  <td style='border:none;padding:.75pt .75pt .75pt .75pt'>
  <p class=MsoNormal><span style='font-size:10.0pt;color:windowtext'><o:p>&nbsp;</o:p></span></p>
  </td>
  <td style='border:none;padding:.75pt .75pt .75pt .75pt'>
  <p class=MsoNormal><span style='font-size:10.0pt;color:windowtext'><o:p>&nbsp;</o:p></span></p>
  </td>
 </tr>
 <tr style='mso-yfti-irow:19'>
  <td valign=top style='padding:.75pt .75pt .75pt .75pt'>
  <p class=MsoNormal><b><span style='font-size:10.0pt'>mysql</span></b></p>
  </td>
  <td valign=top style='padding:.75pt .75pt .75pt .75pt'>
  <p class=MsoNormal><span style='font-size:10.0pt'>A</span></p>
  </td>
  <td valign=top style='padding:.75pt .75pt .75pt .75pt'>
  <p class=MsoNormal><span style='font-size:10.0pt'>MySQL without transaction
  support. You can also set $db-&gt;clientFlags before connecting.</span></p>
  </td>
  <td valign=top style='padding:.75pt .75pt .75pt .75pt'>
  <p class=MsoNormal><span style='font-size:10.0pt'>Y</span></p>
  </td>
  <td valign=top style='padding:.75pt .75pt .75pt .75pt'>
  <p class=MsoNormal><span style='font-size:10.0pt'>MySQL client</span></p>
  </td>
  <td valign=top style='padding:.75pt .75pt .75pt .75pt'>
  <p class=MsoNormal><span style='font-size:10.0pt'>Unix and Windows</span></p>
  </td>
 </tr>
 <tr style='mso-yfti-irow:20'>
  <td valign=top style='padding:.75pt .75pt .75pt .75pt'>
  <p class=MsoNormal><b><span style='font-size:10.0pt'>mysqlt</span></b><span
  style='font-size:10.0pt'> or <b>maxsql</b></span></p>
  </td>
  <td valign=top style='padding:.75pt .75pt .75pt .75pt'>
  <p class=MsoNormal><span style='font-size:10.0pt'>A</span></p>
  </td>
  <td valign=top style='padding:.75pt .75pt .75pt .75pt'>
  <p><span style='font-size:10.0pt'>MySQL with transaction support. We
  recommend using || as the concat operator for best portability. This can be
  done by running MySQL using: <br>
  <i>mysqld --ansi</i> or <i>mysqld --sql-mode=PIPES_AS_CONCAT</i></span></p>
  </td>
  <td valign=top style='padding:.75pt .75pt .75pt .75pt'>
  <p class=MsoNormal><span style='font-size:10.0pt'>Y/N</span></p>
  </td>
  <td valign=top style='padding:.75pt .75pt .75pt .75pt'>
  <p class=MsoNormal><span style='font-size:10.0pt'>MySQL client</span></p>
  </td>
  <td valign=top style='padding:.75pt .75pt .75pt .75pt'>
  <p class=MsoNormal><span style='font-size:10.0pt'>Unix and Windows</span></p>
  </td>
 </tr>
 <tr style='mso-yfti-irow:21'>
  <td valign=top style='padding:.75pt .75pt .75pt .75pt'>
  <p class=MsoNormal><b><span style='font-size:10.0pt'>oci8</span></b></p>
  </td>
  <td valign=top style='padding:.75pt .75pt .75pt .75pt'>
  <p class=MsoNormal><span style='font-size:10.0pt'>A</span></p>
  </td>
  <td valign=top style='padding:.75pt .75pt .75pt .75pt'>
  <p class=MsoNormal><span style='font-size:10.0pt'>Oracle 8/9. Has more
  functionality than <i>oracle</i> driver (eg. Affected_Rows). You might have
  to putenv('ORACLE_HOME=...') before Connect/PConnect. </span></p>
  <p><span style='font-size:10.0pt'>There are 2 ways of connecting - with
  server IP and service name: <br>
  <i>PConnect('serverip:1521','scott','tiger','service'</i>)<br>
  or using an entry in TNSNAMES.ORA or ONAMES or HOSTNAMES: <br>
  <i>PConnect(false, 'scott', 'tiger', $oraname)</i>. </span></p>
  <p><span style='font-size:10.0pt'>Since 2.31, we support Oracle REF cursor
  variables directly (see <a href="#executecursor">ExecuteCursor</a>).</span> </p>
  </td>
  <td valign=top style='padding:.75pt .75pt .75pt .75pt'>
  <p class=MsoNormal><span style='font-size:10.0pt'>Y/N</span></p>
  </td>
  <td valign=top style='padding:.75pt .75pt .75pt .75pt'>
  <p class=MsoNormal><span style='font-size:10.0pt'>Oracle client</span></p>
  </td>
  <td valign=top style='padding:.75pt .75pt .75pt .75pt'>
  <p class=MsoNormal><span style='font-size:10.0pt'>Unix and Windows</span></p>
  </td>
 </tr>
 <tr style='mso-yfti-irow:22'>
  <td valign=top style='padding:.75pt .75pt .75pt .75pt'>
  <p class=MsoNormal><b><span style='font-size:10.0pt'>oci805</span></b></p>
  </td>
  <td valign=top style='padding:.75pt .75pt .75pt .75pt'>
  <p class=MsoNormal><span style='font-size:10.0pt'>C</span></p>
  </td>
  <td valign=top style='padding:.75pt .75pt .75pt .75pt'>
  <p class=MsoNormal><span style='font-size:10.0pt'>Supports reduced Oracle
  functionality for Oracle 8.0.5. SelectLimit is not as efficient as in the
  oci8 or oci8po drivers.</span></p>
  </td>
  <td valign=top style='padding:.75pt .75pt .75pt .75pt'>
  <p class=MsoNormal><span style='font-size:10.0pt'>Y/N</span></p>
  </td>
  <td valign=top style='padding:.75pt .75pt .75pt .75pt'>
  <p class=MsoNormal><span style='font-size:10.0pt'>Oracle client</span></p>
  </td>
  <td valign=top style='padding:.75pt .75pt .75pt .75pt'>
  <p class=MsoNormal><span style='font-size:10.0pt'>Unix and Windows</span></p>
  </td>
 </tr>
 <tr style='mso-yfti-irow:23'>
  <td valign=top style='padding:.75pt .75pt .75pt .75pt'>
  <p class=MsoNormal><b><span style='font-size:10.0pt'>oci8po</span></b></p>
  </td>
  <td valign=top style='padding:.75pt .75pt .75pt .75pt'>
  <p class=MsoNormal><span style='font-size:10.0pt'>A</span></p>
  </td>
  <td valign=top style='padding:.75pt .75pt .75pt .75pt'>
  <p class=MsoNormal><span style='font-size:10.0pt'>Oracle 8/9 portable driver.
  This is nearly identical with the oci8 driver except (a) bind variables in
  Prepare() use the ? convention, instead of :bindvar, (b) field names use the
  more common PHP convention of lowercase names. </span></p>
  <p><span style='font-size:10.0pt'>Use this driver if porting from other
  databases is important. Otherwise the oci8 driver offers better performance. </span></p>
  </td>
  <td valign=top style='padding:.75pt .75pt .75pt .75pt'>
  <p class=MsoNormal><span style='font-size:10.0pt'>Y/N</span></p>
  </td>
  <td valign=top style='padding:.75pt .75pt .75pt .75pt'>
  <p class=MsoNormal><span style='font-size:10.0pt'>Oracle client</span></p>
  </td>
  <td valign=top style='padding:.75pt .75pt .75pt .75pt'>
  <p class=MsoNormal><span style='font-size:10.0pt'>Unix and Windows</span></p>
  </td>
 </tr>
 <tr style='mso-yfti-irow:24'>
  <td valign=top style='padding:.75pt .75pt .75pt .75pt'>
  <p class=MsoNormal><b><span style='font-size:10.0pt'>odbc</span></b></p>
  </td>
  <td valign=top style='padding:.75pt .75pt .75pt .75pt'>
  <p class=MsoNormal><span style='font-size:10.0pt'>A</span></p>
  </td>
  <td valign=top style='padding:.75pt .75pt .75pt .75pt'>
  <p class=MsoNormal><span style='font-size:10.0pt'>Generic ODBC, not tuned for
  specific databases. To connect, use <br>
  PConnect('DSN','user','pwd'). This is the base class for all odbc derived
  drivers.</span></p>
  </td>
  <td valign=top style='padding:.75pt .75pt .75pt .75pt'>
  <p class=MsoNormal><span style='font-size:10.0pt'>? depends on database</span></p>
  </td>
  <td valign=top style='padding:.75pt .75pt .75pt .75pt'>
  <p class=MsoNormal><span style='font-size:10.0pt'>ODBC</span></p>
  </td>
  <td valign=top style='padding:.75pt .75pt .75pt .75pt'>
  <p class=MsoNormal><span style='font-size:10.0pt'>Unix and Windows. <a
  href="http://phpbuilder.com/columns/alberto20000919.php3?page=4">Unix hints.</a></span></p>
  </td>
 </tr>
 <tr style='mso-yfti-irow:25'>
  <td valign=top style='padding:.75pt .75pt .75pt .75pt'>
  <p class=MsoNormal><b><span style='font-size:10.0pt'>odbc_mssql</span></b></p>
  </td>
  <td valign=top style='padding:.75pt .75pt .75pt .75pt'>
  <p class=MsoNormal><span style='font-size:10.0pt'>C</span></p>
  </td>
  <td valign=top style='padding:.75pt .75pt .75pt .75pt'>
  <p class=MsoNormal><span style='font-size:10.0pt'>Uses ODBC to connect to
  MSSQL</span></p>
  </td>
  <td valign=top style='padding:.75pt .75pt .75pt .75pt'>
  <p class=MsoNormal><span style='font-size:10.0pt'>Y/N</span></p>
  </td>
  <td valign=top style='padding:.75pt .75pt .75pt .75pt'>
  <p class=MsoNormal><span style='font-size:10.0pt'>ODBC</span></p>
  </td>
  <td valign=top style='padding:.75pt .75pt .75pt .75pt'>
  <p class=MsoNormal><span style='font-size:10.0pt'>Unix and Windows. </span></p>
  </td>
 </tr>
 <tr style='mso-yfti-irow:26'>
  <td valign=top style='padding:.75pt .75pt .75pt .75pt'>
  <p class=MsoNormal><b><span style='font-size:10.0pt'>odbc_oracle</span></b></p>
  </td>
  <td valign=top style='padding:.75pt .75pt .75pt .75pt'>
  <p class=MsoNormal><span style='font-size:10.0pt'>C</span></p>
  </td>
  <td valign=top style='padding:.75pt .75pt .75pt .75pt'>
  <p class=MsoNormal><span style='font-size:10.0pt'>Uses ODBC to connect to
  Oracle</span></p>
  </td>
  <td valign=top style='padding:.75pt .75pt .75pt .75pt'>
  <p class=MsoNormal><span style='font-size:10.0pt'>Y/N</span></p>
  </td>
  <td valign=top style='padding:.75pt .75pt .75pt .75pt'>
  <p class=MsoNormal><span style='font-size:10.0pt'>ODBC</span></p>
  </td>
  <td valign=top style='padding:.75pt .75pt .75pt .75pt'>
  <p class=MsoNormal><span style='font-size:10.0pt'>Unix and Windows. </span></p>
  </td>
 </tr>
 <tr style='mso-yfti-irow:27'>
  <td valign=top style='padding:.75pt .75pt .75pt .75pt'>
  <p class=MsoNormal><b><span style='font-size:10.0pt'>odbtp</span></b></p>
  </td>
  <td valign=top style='padding:.75pt .75pt .75pt .75pt'>
  <p class=MsoNormal><span style='font-size:10.0pt'>C</span></p>
  </td>
  <td valign=top style='padding:.75pt .75pt .75pt .75pt'>
  <p class=MsoNormal><span style='font-size:10.0pt'>Generic odbtp driver. <a
  href="http://odbtp.sourceforge.net/">Odbtp</a> is a software for accessing
  Windows ODBC data sources from other operating systems.</span></p>
  </td>
  <td valign=top style='padding:.75pt .75pt .75pt .75pt'>
  <p class=MsoNormal><span style='font-size:10.0pt'>Y/N</span></p>
  </td>
  <td valign=top style='padding:.75pt .75pt .75pt .75pt'>
  <p class=MsoNormal><span style='font-size:10.0pt'>odbtp</span></p>
  </td>
  <td valign=top style='padding:.75pt .75pt .75pt .75pt'>
  <p class=MsoNormal><span style='font-size:10.0pt'>Unix and Windows</span></p>
  </td>
 </tr>
 <tr style='mso-yfti-irow:28'>
  <td valign=top style='padding:.75pt .75pt .75pt .75pt'>
  <p class=MsoNormal><b><span style='font-size:10.0pt'>odbtp_unicode</span></b></p>
  </td>
  <td valign=top style='padding:.75pt .75pt .75pt .75pt'>
  <p class=MsoNormal><span style='font-size:10.0pt'>C</span></p>
  </td>
  <td valign=top style='padding:.75pt .75pt .75pt .75pt'>
  <p class=MsoNormal><span style='font-size:10.0pt'>Odtbp with unicode support</span></p>
  </td>
  <td valign=top style='padding:.75pt .75pt .75pt .75pt'>
  <p class=MsoNormal><span style='font-size:10.0pt'>Y/N</span></p>
  </td>
  <td valign=top style='padding:.75pt .75pt .75pt .75pt'>
  <p class=MsoNormal><span style='font-size:10.0pt'>odbtp</span></p>
  </td>
  <td valign=top style='padding:.75pt .75pt .75pt .75pt'>
  <p class=MsoNormal><span style='font-size:10.0pt'>Unix and Windows</span></p>
  </td>
 </tr>
 <tr style='mso-yfti-irow:29;height:25.5pt'>
  <td valign=top style='padding:.75pt .75pt .75pt .75pt;height:25.5pt'>
  <p class=MsoNormal><b><span style='font-size:10.0pt'>oracle</span></b></p>
  </td>
  <td valign=top style='padding:.75pt .75pt .75pt .75pt;height:25.5pt'>
  <p class=MsoNormal><span style='font-size:10.0pt'>C</span></p>
  </td>
  <td valign=top style='padding:.75pt .75pt .75pt .75pt;height:25.5pt'>
  <p class=MsoNormal><span style='font-size:10.0pt'>Implements old Oracle 7
  client API. Use oci8 driver if possible for better performance.</span></p>
  </td>
  <td valign=top style='padding:.75pt .75pt .75pt .75pt;height:25.5pt'>
  <p class=MsoNormal><span style='font-size:10.0pt'>Y/N</span></p>
  </td>
  <td valign=top style='padding:.75pt .75pt .75pt .75pt;height:25.5pt'>
  <p class=MsoNormal><span style='font-size:10.0pt'>Oracle client</span></p>
  </td>
  <td valign=top style='padding:.75pt .75pt .75pt .75pt;height:25.5pt'>
  <p class=MsoNormal><span style='font-size:10.0pt'>Unix and Windows</span></p>
  </td>
 </tr>
 <tr style='mso-yfti-irow:30;height:25.5pt'>
  <td valign=top style='padding:.75pt .75pt .75pt .75pt;height:25.5pt'>
  <p class=MsoNormal><b><span style='font-size:10.0pt'>netezza</span></b></p>
  </td>
  <td valign=top style='padding:.75pt .75pt .75pt .75pt;height:25.5pt'>
  <p class=MsoNormal><span style='font-size:10.0pt'>C</span></p>
  </td>
  <td valign=top style='padding:.75pt .75pt .75pt .75pt;height:25.5pt'>
  <p class=MsoNormal><span style='font-size:10.0pt'>Netezza driver. Netezza is
  based on postgres code-base.</span></p>
  </td>
  <td valign=top style='padding:.75pt .75pt .75pt .75pt;height:25.5pt'>
  <p class=MsoNormal><span style='font-size:10.0pt'>Y</span></p>
  </td>
  <td valign=top style='padding:.75pt .75pt .75pt .75pt;height:25.5pt'>
  <p class=MsoNormal><span style='font-size:10.0pt'>?</span></p>
  </td>
  <td valign=top style='padding:.75pt .75pt .75pt .75pt;height:25.5pt'>
  <p class=MsoNormal><span style='font-size:10.0pt'>?</span></p>
  </td>
 </tr>
 <tr style='mso-yfti-irow:31'>
  <td valign=top style='padding:.75pt .75pt .75pt .75pt'>
  <p class=MsoNormal><b><span style='font-size:10.0pt'>pdo</span></b></p>
  </td>
  <td valign=top style='padding:.75pt .75pt .75pt .75pt'>
  <p class=MsoNormal><span style='font-size:10.0pt'>C</span></p>
  </td>
  <td valign=top style='padding:.75pt .75pt .75pt .75pt'>
  <p class=MsoNormal><span style='font-size:10.0pt'>Generic PDO driver for
  PHP5. </span></p>
  </td>
  <td valign=top style='padding:.75pt .75pt .75pt .75pt'>
  <p class=MsoNormal><span style='font-size:10.0pt'>Y</span></p>
  </td>
  <td valign=top style='padding:.75pt .75pt .75pt .75pt'>
  <p class=MsoNormal><span style='font-size:10.0pt'>PDO extension and database
  specific drivers</span></p>
  </td>
  <td valign=top style='padding:.75pt .75pt .75pt .75pt'>
  <p class=MsoNormal><span style='font-size:10.0pt'>Unix and Windows. </span></p>
  </td>
 </tr>
 <tr style='mso-yfti-irow:32'>
  <td valign=top style='padding:.75pt .75pt .75pt .75pt'>
  <p class=MsoNormal><b><span style='font-size:10.0pt'>postgres</span></b></p>
  </td>
  <td valign=top style='padding:.75pt .75pt .75pt .75pt'>
  <p class=MsoNormal><span style='font-size:10.0pt'>A</span></p>
  </td>
  <td valign=top style='padding:.75pt .75pt .75pt .75pt'>
  <p class=MsoNormal><span style='font-size:10.0pt'>Generic PostgreSQL driver.
  Currently identical to postgres7 driver.</span></p>
  </td>
  <td valign=top style='padding:.75pt .75pt .75pt .75pt'>
  <p class=MsoNormal><span style='font-size:10.0pt'>Y</span></p>
  </td>
  <td valign=top style='padding:.75pt .75pt .75pt .75pt'>
  <p class=MsoNormal><span style='font-size:10.0pt'>PostgreSQL client</span></p>
  </td>
  <td valign=top style='padding:.75pt .75pt .75pt .75pt'>
  <p class=MsoNormal><span style='font-size:10.0pt'>Unix and Windows. </span></p>
  </td>
 </tr>
 <tr style='mso-yfti-irow:33'>
  <td valign=top style='padding:.75pt .75pt .75pt .75pt'>
  <p class=MsoNormal><b><span style='font-size:10.0pt'>postgres64</span></b></p>
  </td>
  <td valign=top style='padding:.75pt .75pt .75pt .75pt'>
  <p class=MsoNormal><span style='font-size:10.0pt'>A</span></p>
  </td>
  <td valign=top style='padding:.75pt .75pt .75pt .75pt'>
  <p class=MsoNormal><span style='font-size:10.0pt'>For PostgreSQL 6.4 and
  earlier which does not support LIMIT internally.</span></p>
  </td>
  <td valign=top style='padding:.75pt .75pt .75pt .75pt'>
  <p class=MsoNormal><span style='font-size:10.0pt'>Y</span></p>
  </td>
  <td valign=top style='padding:.75pt .75pt .75pt .75pt'>
  <p class=MsoNormal><span style='font-size:10.0pt'>PostgreSQL client</span></p>
  </td>
  <td valign=top style='padding:.75pt .75pt .75pt .75pt'>
  <p class=MsoNormal><span style='font-size:10.0pt'>Unix and Windows. </span></p>
  </td>
 </tr>
 <tr style='mso-yfti-irow:34'>
  <td valign=top style='padding:.75pt .75pt .75pt .75pt'>
  <p class=MsoNormal><b><span style='font-size:10.0pt'>postgres7</span></b></p>
  </td>
  <td valign=top style='padding:.75pt .75pt .75pt .75pt'>
  <p class=MsoNormal><span style='font-size:10.0pt'>A</span></p>
  </td>
  <td valign=top style='padding:.75pt .75pt .75pt .75pt'>
  <p class=MsoNormal><span style='font-size:10.0pt'>PostgreSQL which supports
  LIMIT and other version 7 functionality.</span></p>
  </td>
  <td valign=top style='padding:.75pt .75pt .75pt .75pt'>
  <p class=MsoNormal><span style='font-size:10.0pt'>Y</span></p>
  </td>
  <td valign=top style='padding:.75pt .75pt .75pt .75pt'>
  <p class=MsoNormal><span style='font-size:10.0pt'>PostgreSQL client</span></p>
  </td>
  <td valign=top style='padding:.75pt .75pt .75pt .75pt'>
  <p class=MsoNormal><span style='font-size:10.0pt'>Unix and Windows. </span></p>
  </td>
 </tr>
 <tr style='mso-yfti-irow:35'>
  <td valign=top style='padding:.75pt .75pt .75pt .75pt'>
  <p class=MsoNormal><b><span style='font-size:10.0pt'>postgres8</span></b></p>
  </td>
  <td valign=top style='padding:.75pt .75pt .75pt .75pt'>
  <p class=MsoNormal><span style='font-size:10.0pt'>A</span></p>
  </td>
  <td valign=top style='padding:.75pt .75pt .75pt .75pt'>
  <p class=MsoNormal><span style='font-size:10.0pt'>PostgreSQL which supports
  version 8 functionality.</span></p>
  </td>
  <td valign=top style='padding:.75pt .75pt .75pt .75pt'>
  <p class=MsoNormal><span style='font-size:10.0pt'>Y</span></p>
  </td>
  <td valign=top style='padding:.75pt .75pt .75pt .75pt'>
  <p class=MsoNormal><span style='font-size:10.0pt'>PostgreSQL client</span></p>
  </td>
  <td valign=top style='padding:.75pt .75pt .75pt .75pt'>
  <p class=MsoNormal><span style='font-size:10.0pt'>Unix and Windows. </span></p>
  </td>
 </tr>
 <tr style='mso-yfti-irow:36'>
  <td valign=top style='padding:.75pt .75pt .75pt .75pt'>
  <p class=MsoNormal><b><span style='font-size:10.0pt'>sapdb</span></b></p>
  </td>
  <td valign=top style='padding:.75pt .75pt .75pt .75pt'>
  <p class=MsoNormal><span style='font-size:10.0pt'>C</span></p>
  </td>
  <td valign=top style='padding:.75pt .75pt .75pt .75pt'>
  <p class=MsoNormal><span style='font-size:10.0pt'>SAP DB. Should work
  reliably as based on ODBC driver.</span></p>
  </td>
  <td valign=top style='padding:.75pt .75pt .75pt .75pt'>
  <p class=MsoNormal><span style='font-size:10.0pt'>Y/N</span></p>
  </td>
  <td valign=top style='padding:.75pt .75pt .75pt .75pt'>
  <p class=MsoNormal><span style='font-size:10.0pt'>SAP ODBC client</span></p>
  </td>
  <td valign=top style='padding:.75pt .75pt .75pt .75pt'>
  <p><span style='font-size:10.0pt'>?</span></p>
  </td>
 </tr>
 <tr style='mso-yfti-irow:37'>
  <td valign=top style='padding:.75pt .75pt .75pt .75pt'>
  <p class=MsoNormal><b><span style='font-size:10.0pt'>sqlanywhere</span></b></p>
  </td>
  <td valign=top style='padding:.75pt .75pt .75pt .75pt'>
  <p class=MsoNormal><span style='font-size:10.0pt'>C</span></p>
  </td>
  <td valign=top style='padding:.75pt .75pt .75pt .75pt'>
  <p class=MsoNormal><span style='font-size:10.0pt'>Sybase SQL Anywhere. Should
  work reliably as based on ODBC driver.</span></p>
  </td>
  <td valign=top style='padding:.75pt .75pt .75pt .75pt'>
  <p class=MsoNormal><span style='font-size:10.0pt'>Y/N</span></p>
  </td>
  <td valign=top style='padding:.75pt .75pt .75pt .75pt'>
  <p class=MsoNormal><span style='font-size:10.0pt'>SQL Anywhere ODBC client</span></p>
  </td>
  <td valign=top style='padding:.75pt .75pt .75pt .75pt'>
  <p><span style='font-size:10.0pt'>?</span></p>
  </td>
 </tr>
 <tr style='mso-yfti-irow:38;height:40.5pt'>
  <td valign=top style='padding:.75pt .75pt .75pt .75pt;height:40.5pt'>
  <p class=MsoNormal><b><span style='font-size:10.0pt'>sqlite</span></b></p>
  </td>
  <td valign=top style='padding:.75pt .75pt .75pt .75pt;height:40.5pt'>
  <p class=MsoNormal><span style='font-size:10.0pt'>B</span></p>
  </td>
  <td valign=top style='padding:.75pt .75pt .75pt .75pt;height:40.5pt'>
  <p class=MsoNormal><span style='font-size:10.0pt'>SQLite.</span></p>
  </td>
  <td valign=top style='padding:.75pt .75pt .75pt .75pt;height:40.5pt'>
  <p class=MsoNormal><span style='font-size:10.0pt'>Y</span></p>
  </td>
  <td valign=top style='padding:.75pt .75pt .75pt .75pt;height:40.5pt'>
  <p class=MsoNormal><span style='font-size:10.0pt'>-</span></p>
  </td>
  <td valign=top style='padding:.75pt .75pt .75pt .75pt;height:40.5pt'>
  <p><span style='font-size:10.0pt'>Unix and Windows.</span></p>
  </td>
 </tr>
 <tr style='mso-yfti-irow:39;height:40.5pt'>
  <td valign=top style='padding:.75pt .75pt .75pt .75pt;height:40.5pt'>
  <p class=MsoNormal><b><span style='font-size:10.0pt'>sqlitepo</span></b></p>
  </td>
  <td valign=top style='padding:.75pt .75pt .75pt .75pt;height:40.5pt'>
  <p class=MsoNormal><span style='font-size:10.0pt'>B</span></p>
  </td>
  <td valign=top style='padding:.75pt .75pt .75pt .75pt;height:40.5pt'>
  <p class=MsoNormal><span style='font-size:10.0pt'>Portable SQLite driver. This
  is because assoc mode does not work like other drivers in sqlite. Namely,
  when selecting (joining) multiple tables, the table names are included in the
  assoc keys in the &quot;sqlite&quot; driver.</span></p>
  <p><span style='font-size:10.0pt'>In &quot;sqlitepo&quot; driver, the table
  names are stripped from the returned column names. When this results in a
  conflict, the first field get preference. </span></p>
  </td>
  <td valign=top style='padding:.75pt .75pt .75pt .75pt;height:40.5pt'>
  <p class=MsoNormal><span style='font-size:10.0pt'>Y</span></p>
  </td>
  <td valign=top style='padding:.75pt .75pt .75pt .75pt;height:40.5pt'>
  <p class=MsoNormal><span style='font-size:10.0pt'>-</span></p>
  </td>
  <td valign=top style='padding:.75pt .75pt .75pt .75pt;height:40.5pt'>
  <p><span style='font-size:10.0pt'>Unix and Windows.</span></p>
  </td>
 </tr>
 <tr style='mso-yfti-irow:40'>
  <td valign=top style='padding:.75pt .75pt .75pt .75pt'>
  <p class=MsoNormal><b><span style='font-size:10.0pt'>sybase</span></b></p>
  </td>
  <td valign=top style='padding:.75pt .75pt .75pt .75pt'>
  <p class=MsoNormal><span style='font-size:10.0pt'>C</span></p>
  </td>
  <td valign=top style='padding:.75pt .75pt .75pt .75pt'>
  <p class=MsoNormal><span style='font-size:10.0pt'>Sybase. </span></p>
  </td>
  <td valign=top style='padding:.75pt .75pt .75pt .75pt'>
  <p class=MsoNormal><span style='font-size:10.0pt'>Y/N</span></p>
  </td>
  <td valign=top style='padding:.75pt .75pt .75pt .75pt'>
  <p class=MsoNormal><span style='font-size:10.0pt'>Sybase client</span></p>
  </td>
  <td valign=top style='padding:.75pt .75pt .75pt .75pt'>
  <p><span style='font-size:10.0pt'>Unix and Windows.</span></p>
  </td>
 </tr>
 <tr style='mso-yfti-irow:41;mso-yfti-lastrow:yes'>
  <td valign=top style='padding:.75pt .75pt .75pt .75pt'>
  <p class=MsoNormal><b><span style='font-size:10.0pt'>sybase_ase</span></b></p>
  </td>
  <td valign=top style='padding:.75pt .75pt .75pt .75pt'>
  <p class=MsoNormal><span style='font-size:10.0pt'>C</span></p>
  </td>
  <td valign=top style='padding:.75pt .75pt .75pt .75pt'>
  <p class=MsoNormal><span style='font-size:10.0pt'>Sybase ASE. </span></p>
  </td>
  <td valign=top style='padding:.75pt .75pt .75pt .75pt'>
  <p class=MsoNormal><span style='font-size:10.0pt'>Y/N</span></p>
  </td>
  <td valign=top style='padding:.75pt .75pt .75pt .75pt'>
  <p class=MsoNormal><span style='font-size:10.0pt'>Sybase client</span></p>
  </td>
  <td valign=top style='padding:.75pt .75pt .75pt .75pt'>
  <p><span style='font-size:10.0pt'>Unix and Windows.</span></p>
  </td>
 </tr>
</table>

<p>The &quot;Tested&quot; column indicates how extensively the code has been
tested and used. <br>
A = well tested and used by many people<br>
B = tested and usable, but some features might not be implemented<br>
C = user contributed or experimental driver. Might not fully support all of the
latest features of ADOdb. </p>

<p>The column &quot;RecordCount() usable&quot; indicates whether RecordCount()
return the number of rows, or returns -1 when a SELECT statement is executed.
If this column displays Y/N then the RecordCount() is emulated when the global
variable $ADODB_COUNTRECS=true (this is the default). Note that for large
recordsets, it might be better to disable RecordCount() emulation because
substantial amounts of memory are required to cache the recordset for counting.
Also there is a speed penalty of 40-50% if emulation is required. This is
emulated in most databases except for PostgreSQL and MySQL. This variable is
checked every time a query is executed, so you can selectively choose which
recordsets to count.</p>

<div class=MsoNormal align=center style='text-align:center'>

<hr size=2 width="100%" align=center>

</div>

<h1>Tutorials<a name=quickstart></a></h1>

<h3>Example 1: Select Statement<a name=ex1></a></h3>

<p>Task: Connect to the Access Northwind DSN, display the first 2 columns of
each row.</p>

<p>In this example, we create a ADOConnection object, which represents the
connection to the database. The connection is initiated with <a href="#pconnect"><span
style='font-family:"Courier New"'>PConnect</span></a>, which is a persistent
connection. Whenever we want to query the database, we call the <span
style='font-family:"Courier New"'>ADOConnection.<a href="#execute">Execute</a>()</span>
function. This returns an ADORecordSet object which is actually a cursor that
holds the current row in the array <span style='font-family:"Courier New"'>fields[]</span>.
We use <span style='font-family:"Courier New"'><a href="#movenext">MoveNext</a>()</span>
to move from row to row.</p>

<p>NB: A useful function that is not used in this example is <span
style='font-family:"Courier New"'><a href="#selectlimit">SelectLimit</a></span>,
which allows us to limit the number of rows shown. </p>

<div style='mso-element:para-border-div;border:solid #DDDDDD 1.0pt;mso-border-alt:
solid #DDDDDD .75pt;padding:9.0pt 18.0pt 9.0pt 18.0pt;background:#EEEEEE'><pre>&lt;?<br>
<b>include</b>('adodb.inc.php');<span style='mso-tab-count:1'> </span><span style='mso-spacerun:yes'>   </span># load code common to ADOdb<br>
$<span style='color:#660000'>conn</span> = &amp;ADONewConnection('access');<span
style='mso-tab-count:1'>        </span># create a connection<br>
$<span style='color:#660000'>conn</span>-&gt;PConnect('northwind');<span style='mso-spacerun:yes'>   </span># connect to MS-Access, northwind DSN<br>
$<span style='color:#660000'>recordSet</span> = &amp;$<span style='color:#660000'>conn</span>-&gt;Execute('select * from products');<br>
if (!$<span style='color:#660000'>recordSet</span>) <br>
<span style='mso-tab-count:1'>         </span>print $<span style='color:#660000'>conn</span>-&gt;ErrorMsg();<br>
else<br>
<b>while</b> (!$<span style='color:#660000'>recordSet</span>-&gt;EOF) {<br>
<span style='mso-tab-count:1'>         </span><b>print</b> $<span
style='color:#660000'>recordSet</span>-&gt;fields[0].' '.$<span
style='color:#660000'>recordSet</span>-&gt;fields[1].'&lt;BR&gt;';<br>
<span style='mso-tab-count:1'>         </span>$<span style='color:#660000'>recordSet</span>-&gt;MoveNext();<br>
}</pre><pre><o:p>&nbsp;</o:p></pre><pre>$<span style='color:#660000'>recordSet</span>-&gt;Close(); # optional<br>
$<span style='color:#660000'>conn</span>-&gt;Close(); # optional<br
style='mso-special-character:line-break'>
<![if !supportLineBreakNewLine]><br style='mso-special-character:line-break'>
<![endif]></pre><pre>?&gt;</pre></div>

<p>The $<span style='font-family:"Courier New"'>recordSet</span> returned
stores the current row in the <span style='font-family:"Courier New"'>$recordSet-&gt;fields</span>
array, indexed by column number (starting from zero). We use the <span
style='font-family:"Courier New"'><a href="#movenext">MoveNext</a>()</span>
function to move to the next row. The <span style='font-family:"Courier New"'>EOF</span>
property is set to true when end-of-file is reached. If an error occurs in
Execute(), we return false instead of a recordset.</p>

<p>The <code><span style='font-size:10.0pt'>$recordSet-&gt;fields[]</span></code>
array is generated by the PHP database extension. Some database extensions only
index by number and do not index the array by field name. To force indexing by
name - that is associative arrays - use the SetFetchMode function. Each
recordset saves and uses whatever fetch mode was set when the recordset was
created in Execute() or SelectLimit(). </p>

<div style='mso-element:para-border-div;border:solid #DDDDDD 1.0pt;mso-border-alt:
solid #DDDDDD .75pt;padding:9.0pt 18.0pt 9.0pt 18.0pt;background:#EEEEEE'><pre><span
style='mso-tab-count:1'>         </span>$db-&gt;SetFetchMode(ADODB_FETCH_NUM);<br>
<span style='mso-tab-count:1'>         </span>$rs1 = $db-&gt;Execute('select * from table');<br>
<span style='mso-tab-count:1'>         </span>$db-&gt;SetFetchMode(ADODB_FETCH_ASSOC);<br>
<span style='mso-tab-count:1'>         </span>$rs2 = $db-&gt;Execute('select * from table');<br>
<span style='mso-tab-count:1'>         </span>print_r($rs1-&gt;fields); # shows <i>array([0]=&gt;'v0',[1] =&gt;'v1')</i></pre><pre><span
style='mso-tab-count:1'>         </span>print_r($rs2-&gt;fields); # shows <i>array(['col1']=&gt;'v0',['col2'] =&gt;'v1')</i></pre></div>

<p>To get the number of rows in the select statement, you can use <span
style='font-family:"Courier New"'>$recordSet-&gt;<a href="#recordcount">RecordCount</a>()</span>.
Note that it can return -1 if the number of rows returned cannot be determined.</p>

<h3>Example 2: Advanced Select with Field Objects<a name=ex2></a></h3>

<p>Select a table, display the first two columns. If the second column is a
date or timestamp, reformat the date to <st1:country-region w:st="on"><st1:place
 w:st="on">US</st1:place></st1:country-region> format.</p>

<div style='mso-element:para-border-div;border:solid #DDDDDD 1.0pt;mso-border-alt:
solid #DDDDDD .75pt;padding:9.0pt 18.0pt 9.0pt 18.0pt;background:#EEEEEE'><pre>&lt;?<br>
<b>include</b>('adodb.inc.php');<span style='mso-tab-count:1'> </span><span style='mso-spacerun:yes'>   </span># load code common to ADOdb<br>
$<span style='color:#660000'>conn</span> = &amp;ADONewConnection('access');<span
style='mso-tab-count:1'>        </span># create a connection<br>
$<span style='color:#660000'>conn</span>-&gt;PConnect('northwind');<span style='mso-spacerun:yes'>   </span># connect to MS-Access, northwind dsn<br>
$<span style='color:#660000'>recordSet</span> = &amp;$<span style='color:#660000'>conn</span>-&gt;Execute('select CustomerID,OrderDate from Orders');<br>
if (!$<span style='color:#660000'>recordSet</span>) <br>
<span style='mso-tab-count:1'>         </span>print $<span style='color:#660000'>conn</span>-&gt;ErrorMsg();<br>
else<br>
<b>while</b> (!$<span style='color:#660000'>recordSet</span>-&gt;EOF) {<br>
<span style='mso-tab-count:1'>         </span>$<span style='color:#660000'>fld</span> = <b><span
style='color:#336600'>$</span></b><span style='color:#660000'>recordSet</span><b><span
style='color:#336600'>-&gt;FetchField</span></b><span style='color:#006600'>(</span>1<span
style='color:#006600'>);</span></pre><pre><span style='mso-tab-count:1'>         </span>$<span
style='color:#660000'>type</span> = <b><span style='color:#336600'>$</span></b><span
style='color:#660000'>recordSet</span><b><span style='color:#336600'>-&gt;MetaType</span></b>($fld-&gt;type);<br>
<br>
<span style='mso-tab-count:1'>         </span><b>if</b> ( $<span
style='color:#660000'>type</span> == 'D' || $<span style='color:#660000'>type</span> == 'T') <br>
<span style='mso-tab-count:2'>                 </span><b>print</b> $<span
style='color:#660000'>recordSet</span>-&gt;fields[0].' '.