ADOdb

Database Abstraction Layer for PHP

User Tools

Site Tools


v5:reference:recordset:fieldtypesarray

Differences

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

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
v5:reference:recordset:fieldtypesarray [2016/02/01 21:46] – [Description] mnewnhamv5:reference:recordset:fieldtypesarray [2021/05/05 03:31] (current) mnewnham
Line 2: Line 2:
 ~~NOTOC~~ ~~NOTOC~~
 <WRAP right box> <WRAP right box>
 +== See Also ==
 +[[v5:reference:recordset:fetchField|fetchField()]]\\
 +[[v5:reference:recordset:fieldCount|fieldCount()]]\\
 == Syntax == == Syntax ==
-  array fieldTypesArray()+  mixed fieldTypesArray()
 </WRAP> </WRAP>
  
 ===== Description ===== ===== Description =====
-The method returns an array of [[v5:dictionary:ADOfieldObject|ADOFieldObjects]] representing all of the objects returned in a result set. It is the equivalent of looping from 1 to [[v5:reference:fieldCount]]+The method returns an array of [[v5:dictionary:ADOfieldObject|ADOFieldObjects]] representing all of the objects returned in a result set. It is the equivalent of looping from 1 to [[v5:reference:recordset:fieldCount]] , calling the [[v5:reference:recordset:fetchField]] method. The method returns **false** if a recordset is not available for any reason 
 +------------------------------------- 
 +===== Example ===== 
 +This example uses a postgres database so returns numerous Postgress specific fields 
 +<code php> 
 + 
 +$sql = "SELECT * FROM dept_emp"; 
 + 
 +$result = $db->execute($sql) 
 + 
 +print_r($resul->fieldTypesArray()); 
 + 
 +/* 
 +* Returns 
 +Array 
 +
 +    [0] => ADOFieldObject Object 
 +        ( 
 +            [name] => emp_no 
 +            [max_length] => 0 
 +            [type] => 3 
 +            [orgname] => emp_no 
 +            [table] => dept_emp 
 +            [orgtable] => dept_emp 
 +            [def] =>  
 +            [db] => employees 
 +            [catalog] => def 
 +            [length] => 11 
 +            [charsetnr] => 63 
 +            [flags] => 53251 
 +            [decimals] => 0 
 +            [primary_key] => 2 
 +            [not_null] => 1 
 +            [auto_increment] => 0 
 +            [binary] => 0 
 +            [unsigned] => 0 
 +        ) 
 + 
 +    [1] => ADOFieldObject Object 
 +        ( 
 +            [name] => dept_no 
 +            [max_length] => 4 
 +            [type] => 254 
 +            [orgname] => dept_no 
 +            [table] => dept_emp 
 +            [orgtable] => dept_emp 
 +            [def] =>  
 +            [db] => employees 
 +            [catalog] => def 
 +            [length] => 16 
 +            [charsetnr] => 255 
 +            [flags] => 20491 
 +            [decimals] => 0 
 +            [primary_key] => 2 
 +            [not_null] => 1 
 +            [auto_increment] => 0 
 +            [binary] => 0 
 +            [unsigned] => 0 
 +        ) 
 + 
 +    [2] => ADOFieldObject Object 
 +        ( 
 +            [name] => from_date 
 +            [max_length] => 10 
 +            [type] => 10 
 +            [orgname] => from_date 
 +            [table] => dept_emp 
 +            [orgtable] => dept_emp 
 +            [def] =>  
 +            [db] => employees 
 +            [catalog] => def 
 +            [length] => 10 
 +            [charsetnr] => 63 
 +            [flags] => 4225 
 +            [decimals] => 0 
 +            [primary_key] => 0 
 +            [not_null] => 1 
 +            [auto_increment] => 0 
 +            [binary] => 128 
 +            [unsigned] => 0 
 +        ) 
 +......etc. 
 +*/ 
 +</code>
v5/reference/recordset/fieldtypesarray.1454359617.txt.gz · Last modified: 2017/04/21 11:37 (external edit)