ADOdb

Database Abstraction Layer for PHP

User Tools

Site Tools


addons:addons_index

Differences

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

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
addons:addons_index [2016/01/13 04:10] – ↷ Page name changed from addons:index to addons:addons_index mnewnhamaddons:addons_index [Unknown date] (current) – removed - external edit (Unknown date) 127.0.0.1
Line 1: Line 1:
-====== Unsupported Addons ====== 
-These addon utilities are distributed as part of ADOdb, but are provided as-is, with no confirmation of compatibility with later versions of PHP or operating system, or of compatibility with a specific driver. Fixes and updates are always welcome. 
------------------------ 
-<WRAP right box> 
-== Requires == 
-  tohtml.inc.php 
-   
-== Syntax == 
-  string rs2html ( 
-      object $recordset, 
-      optional string $tableStyles=false, 
-      optional array $columnHeaders=false, 
-      optional bool $htmlspecialchars=true, 
-      optional bool $echo = true 
-      ) 
-</WRAP> 
-       
-===== rs2html ===== 
-This addon provides a method of displaying a recordset in an html table. In its simplest implementation, it can be used just by passing a recordset. This is an easy way to display a retrieved recordset for debugging purposes. 
-==== Parameters ==== 
-=== $recordset === 
-A handle to an ADOdb recordset, provided by an ''execute()'' or a ''selectLimit()'' statement. 
-=== $tableStyles === 
-Historically this parameter was used for items like 'border' and 'width' but can also be used for modern attributes such as 'class' and 'style'. Double quotes in the statement should be escaped. 
-=== $columnHeaders === 
-If provided, the numeric array is used for column headers instead of the field names. It **must** contain index entries for all columns.  
-=== $htmlSpecialChars === 
-By default, the PHP function htmlSpecialChars is applied to all values. This parameter disables this functionality.  
-=== $echo === 
-By default, the output is echoed directly to the screen. If the value is set to false, the output is collected in a string and returned from the function. 
-==== Global Variables ==== 
-THe following variables may be defined, and are globalized into the function  
-^Variable^Description^ 
-|$gSQLMaxRows|The maximum number of rows displayed in the table. This does not affect the number of rows retrieved| 
-|$gSQLBlockRows|The records returned are grouped into blocks of this number of records. Historically, this feature was used to improve rendering speed. | 
-|$ADODB_ROUND| The number of decimal places that floating point numbers are rounded to| 
  
-==== Usage ==== 
-<code php> 
-/* 
-* Connection to Access northwind database 
-*/ 
-include 'adodb/adodb.inc.php'; 
-include 'adodb/tohtml.inc.php'; 
- 
-$db = newAdoConnection('access'); 
- 
-$sql = 'select * from orders' 
-$recordset = $db->execute($sql); 
- 
-$tableStyles = "class=\"rs2class\" style='border:1px dashed silver'"; 
-rs2html($recordset,$tableStyles); 
-</code> 
--------------------------------------- 
-===== rs2csv & rs2tab==== 
-<WRAP right box> 
-== Requires == 
-  toexport.inc.php 
-   
-== Syntax == 
- 
-  string rs2csv( 
-     obj $recordSet 
-     optional bool $addTitles=true 
-     ) 
-      
-  string rs2tab( 
-     obj $recordSet 
-     optional bool $addTitles=true 
-     ) 
-</WRAP> 
- 
-==== Description ==== 
-The function ''rs2csv()'' takes a recordset object as an argument and returns the data as a string containing a CSV format file. If selected, the first row contains the column names. The rs2tab function returns the data as tab separated data 
- 
-==== Usage ==== 
-<code php> 
-/* 
-* Connection to Northwind Database 
-*/ 
-$sql = "SELECT * FROM orders"; 
- 
-$recordset = $db->execute($sql); 
- 
-$csv = rs2csv($recordset);     
-</code> 
---------------------------------------- 
- 
-<WRAP right info 300px> 
-String fields are not quoted or escaped per standard CSV format 
-</WRAP> 
------------------------------------------- 
-===== rs2csvfile & rs2tabfile==== 
-<WRAP right box> 
-== Requires == 
-  toexport.inc.php 
-   
-== Syntax == 
- 
-  void rs2csvfile( 
-     obj $recordSet 
-     handle $filePointer 
-     optional bool $addTitles=true 
-     ) 
-      
-     void rs2tabfile( 
-     obj $recordSet 
-     handle $filePointer 
-     optional bool $addTitles=true 
-     ) 
-</WRAP> 
- 
-==== Description ==== 
-The function ''rs2csvfile()'' takes a recordset object as an argument and outputs the data to a CSV file indicated by the file pointer $filePointer  . If selected, the first row contains the column names. The ''rs2tabfile()'' function returns the data as tab-separated. 
- 
-==== Usage ==== 
-<code php> 
-/* 
-* Connection to Northwind Database 
-*/ 
- 
-$filePointer = fopen('/tmp/products.csv','w'); 
-$sql = "SELECT * FROM products"; 
- 
-$recordset = $db->execute($sql); 
- 
-$csv = rs2csv($recordset, $filePointer);     
-</code> 
----------------------------------------------- 
- 
-<WRAP right info 300px> 
-String fields are not quoted or escaped per standard CSV format 
-</WRAP>  
- 
--------------------------------------------------------- 
- 
-===== rs2csvout & rs2tabout==== 
-<WRAP right box> 
-== Requires == 
-  toexport.inc.php 
-   
-== Syntax == 
- 
-  string rs2csvout( 
-     obj $recordSet 
-     optional bool $addTitles=true 
-     ) 
-      
-   string rs2tabout( 
-     obj $recordSet 
-     optional bool $addTitles=true 
-     ) 
-</WRAP> 
- 
-==== Description ==== 
-The function ''rs2csvout()'' takes a recordset object as an argument and sends the data as a string containing a CSV format file to the PHP STDOUT. If selected, the first row contains the column names. The function ''rs2tabout()''. Returns the data in tab-separated format. 
- 
-==== Usage ==== 
-<code php> 
-/* 
-* Connection to Northwind Database 
-*/ 
-$sql = "SELECT * FROM products"; 
- 
-$recordset = $db->execute($sql); 
- 
-$csv = rs2tabout($recordset);     
-</code> 
-------------------------- 
- 
-<WRAP right info 300px> 
-String fields are not quoted or escaped per standard CSV format 
-</WRAP> 
------------------------------- 
-===== The xmlrpc library ====== 
-This addon provides an interface between the adodb recordset and the php xmlrpc library. [[addons:xmlrpc|More Information]]. 
addons/addons_index.1452654612.txt.gz · Last modified: 2017/04/21 11:19 (external edit)