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

 ID:               51202
 Updated by:       [email protected]
 Reported by:      houssam dot asaad at hiast dot edu dot sy
 Summary:          use oci8 result with smarty
 Status:           Open
 Type:             Feature/Change Request
 Package:          OCI8 related
 Operating System: Win
 PHP Version:      5.3.1
 Assigned To:      sixd

 New Comment:

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


Previous Comments:
------------------------------------------------------------------------
[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

Reply via email to