ADOdb

Database Abstraction Layer for PHP

User Tools

Site Tools


v5:userguide:learn_fields:field_objects

Differences

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

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
v5:userguide:learn_fields:field_objects [2020/01/02 12:03] – ↷ Links adapted because of a move operation dregadv5:userguide:learn_fields:field_objects [2021/03/09 09:38] (current) – [Interrogating The Columns] wrong variable name in code sample dregad
Line 2: Line 2:
 ~~NOTOC~~ ~~NOTOC~~
 ====== Fields As Objects ====== ====== Fields As Objects ======
-In Lesson 2, the concept of the **//ActualTypes//** was explained. In this section, we show how the value of field, and also the attributes of the same field can be obtained. By treating the returned result set as a 2 dimensional array, we can process each row on a column-by-column basis.+In Lesson 2, the concept of the **//ActualTypes//** was explained.  
 +In this section, we show how the value of field, as well as its attributescan be obtained.  
 +By treating the returned result set as a 2 dimensional array, we can process each row on a column-by-column basis.
  
 ===== The Limits Of The Array ===== ===== The Limits Of The Array =====
Line 49: Line 51:
          */           */ 
          $fieldInfo = $recordSet->fetchField($colIndex);          $fieldInfo = $recordSet->fetchField($colIndex);
-         $type      = $recordSet->metaType($fld->type);+         $type      = $recordSet->metaType($fieldInfo->type);
            
          /*          /*
          * This is the value of the field          * This is the value of the field
          */          */
-         $value     = $recordSet->fields[$colIndex];+         $value     = $recordSet->fields($colIndex);
                        
 </code> </code>
v5/userguide/learn_fields/field_objects.txt · Last modified: 2021/03/09 09:38 by dregad