Req #51202 [Asn->Bgs]: use oci8 result with smarty

From: Date: Fri, 05 Mar 2010 07:04:06 +0000
Subject: Req #51202 [Asn->Bgs]: use oci8 result with smarty
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-148290@lists.php.net to get a copy of this message
Edit report at http://bugs.php.net/bug.php?id=51202&edit=1

 ID:               51202
 Updated by:       sixd@php.net
 Reported by:      houssam dot asaad at hiast dot edu dot sy
 Summary:          use oci8 result with smarty
-Status:           Assigned
+Status:           Bogus
 Type:             Feature/Change Request
 Package:          OCI8 related
 Operating System: Win
 PHP Version:      5.3.1
 Assigned To:      sixd

 New Comment:

.


Previous Comments:
------------------------------------------------------------------------
[2010-03-05 08:03:18] sixd@php.net

oci_fetch_array() only returns one row.  It's called "array" because the
column 
values for that row are stored in an array.  See
http://www.php.net/manual/en/function.oci-fetch-array.php

Try oci_fetch_all():
http://www.php.net/manual/en/function.oci-fetch-all.php

------------------------------------------------------------------------
[2010-03-04 15:41:22] houssam dot asaad at hiast dot edu dot sy

Description:
------------
Hi 
I use oci8 php file to connect with oracle db like this: 
then, I use smarty file to display data 
I would like to use smarty file to display array data 
i got only one record with foreach statment (my table contains many
records)




Test script:
---------------
in php file:
$conn = oci_connect('username', 'passwd', ip-server/My_db'); 
$query = 'select * from my_table'; 
$stid = oci_parse($conn, $query); 
oci_execute($stid, OCI_DEFAULT); 
$row = oci_fetch_array($stid, OCI_ASSOC); 
in smarty file:

{foreach from=$row item=soso}
        {foreach from=$soso item=fofo}
            {$fofo}
        {/foreach}
{/foreach}


Actual result:
--------------
10359 4 1 14-JAN-10 119 2010 5


------------------------------------------------------------------------



-- 
Edit this bug report at http://bugs.php.net/bug.php?id=51202&edit=1


Thread (3 messages)

« previous php.bugs (#148290) next »