php + oracle problems with use OCI8

Do you have questions regarding other database enginges (not MySQL) -- ask here!

Moderators: macek, egami, gesf

rum
New php-forum User
New php-forum User
Posts: 1
Joined: Thu Jan 27, 2011 1:33 am

php + oracle problems with use OCI8

Postby rum » Thu Jan 27, 2011 1:41 am

Hellow)
I'm worked with linux, use oracle 10g XE and instantclient version 11_2.
I'm make the table:

Code: Select all

    create table directions (id number PRIMARY KEY, name varchar(40));

And wrote some script for this table:

Code: Select all

    $stid = oci_parse($con, 'SELECT * FROM directions');
oci_execute($stid);
while ($row = oci_fetch_array($stid, OCI_ASSOC+OCI_RETURN_NULLS))
      {
             foreach ($row as $item) {
                                echo $item;
                        }
                }

Everything work good!

After thet i mike a one new table:

Code: Select all

     create table stations (id number PRIMARY KEY,name varchar(255),direction_id number,FOREIGN KEY (direction_id) references directions (id));

and use next script:

Code: Select all

  $stid = oci_parse($con, 'SELECT * FROM stations');
oci_execute($stid);
while ($row = oci_fetch_array($stid, OCI_ASSOC+OCI_RETURN_NULLS))
      {
             foreach ($row as $item) {
                                echo $item;
                        }
                }

And $row is empty....What problems???Maybe with linking field??
:oops: please help me)

Return to “Other Database Engines”

Who is online

Users browsing this forum: No registered users and 0 guests

cron