php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Request #51202 use oci8 result with smarty
Submitted: 2010-03-04 15:41 UTC Modified: 2010-03-05 08:04 UTC
From: houssam dot asaad at hiast dot edu dot sy Assigned: sixd (profile)
Status: Not a bug Package: OCI8 related
PHP Version: 5.3.1 OS: Win
Private report: No CVE-ID: None
View Add Comment Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
You can add a comment by following this link or if you reported this bug, you can edit this bug over here.
(description)
Block user comment
Status: Assign to:
Package:
Bug Type:
Summary:
From: houssam dot asaad at hiast dot edu dot sy
New email:
PHP Version: OS:

 

 [2010-03-04 15:41 UTC] 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

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2010-03-05 08:03 UTC] 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-05 08:04 UTC] sixd@php.net
-Status: Assigned +Status: Bogus
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Tue Apr 16 14:01:29 2024 UTC