note 45515 modified in function.ocifetchstatement by sixd

From: Date: Thu, 08 Oct 2009 19:19:48 +0000
Subject: note 45515 modified in function.ocifetchstatement by sixd
References: 1  Groups: php.notes 
Request: Send a blank email to php-notes+get-161538@lists.php.net to get a copy of this message
Humberto, from the previous note misunderstood the function ocifetchstatement. The default value of the last parameter is OCI_FETCHSTATEMENT_BY_COLUMN. That is the reason that $rows has the value 20 and count($arr) has the value 13 in: $rows=ocifetchstatement ($st, &$arr, 0, 20); It happens because his query probably had 13 columns. That way, count($arr[0]) would have the value 20 that he expected of count($arr). So, $rows=ocifetchstatement ($st, &$arr, 0, 20); is equivalent to $rows=ocifetchstatement ($st, &$arr, 0, 20, OCI_FETCHSTATEMENT_BY_COLUMN); and it is not equivalent to $rows=ocifetchstatement ($st, &$arr, 0, 20, OCI_FETCHSTATEMENT_BY_ROW); I hope this helps to avoid some confusion about ocifetchstatement. --was-- Humberto, from the previous note misunderstood the function ocifetchstatement. The default value of the last parameter is OCI_FETCHSTATEMENT_BY_COLUMN. That is the reason that $rows has the value 20 and count($arr) has the value 13 in: $rows=ocifetchstatement ($st, &$arr, 0, 20); It happens because his query probably had 13 columns. That way, count($arr[0]) would have the value 20 that he expected of count($arr). So, $rows=ocifetchstatement ($st, &$arr, 0, 20); is equivalent to $rows=ocifetchstatement ($st, &$arr, 0, 20, OCI_FETCHSTATEMENT_BY_COLUMN); and it is not equivalent to $rows=ocifetchstatement ($st, &$arr, 0, 20, OCI_FETCHSTATEMENT_BY_ROW); I hope this helps to avoid some confusion about ocifetchstatement. http://php.net/manual/en/function.ocifetchstatement.php

« previous php.notes (#161538) next »