Re: Ynt: [PHP-DB] Again: Interbase DLL
| From: | Meir Kriheli | Date: | Mon, 14 Aug 2000 22:14:48 +0000 |
| Subject: | Re: Ynt: [PHP-DB] Again: Interbase DLL | ||
| References: | 1 2 3 | Groups: | php.db |
| Request: | Send a blank email to php-db+get-2049@lists.php.net to get a copy of this message | ||
Hi Scott
On Mon, 14 Aug 2000, Scott Burch wrote:
>
> You are correct. That is what it should be. I had tried that too, but get a
> different error, which led me to try the one I submitted. Notice that the
> print($dbh) returns 'Resource id #1'. Is that what a database handle is suppose
> to return?
Yes.
You're using ibase_fetch_object in the wrong way. ibase_fetch object returns a
pseudo-object so the correct usage for it would be :
$row = ibase_fetch_object(...);
echo $row->_field_name.
e.g.:
echo $row->client_name.
Please note that this is case sensitive (I think).
try to correct that, and see if it helps.
If not, Try ibase_connect, and later ibase_close and see if that
works. If so the connection is OK (you seem to be getting resource id so that's
OK).
Later add only ibase_query, and ibase_free_result. , and if it is OK, then do
the while.
Please let me know how it goes.
--
Meir Kriheli
MKsoft computer systems
"There's someone in my head but it's not me" - Pink Floyd
> I think the connect is working, but I must be doing something wrong
> with the query. That same query works fine in the IBCONSOLE, so I am stuck.
>
> Resource id #1
> Warning: 0 is not a valid InterBase link resource in c:\apache\htdocs/styles.php
> on line 12
>
> Warning: InterBase: invalid database handle (no active connection) in
> c:\apache\htdocs/styles.php on line 12
>
> Warning: Supplied argument is not a valid InterBase result resource in
> c:\apache\htdocs/styles.php on line 15
>
> <?php
> $host = 'morpheus:E:\Devl\FSTEIN\DATA\Fmdata.gdb';
> $user = 'SYSDBA';
> $password = 'masterkey';
> $dbh = ibase_connect($host, $user, $password);
> print($dbh);
>
> $stmt = 'SELECT * FROM STYLES';
> $sth = ibase_query($dbh, $stmt);
> print($sth);
>
> while ($row = ibase_fetch_object($sth)) {
> print($row);
> }
>
> ibase_close($dbh);
> ?>
>
> Meir Kriheli - MKsoft wrote:
>
> > Shouldn't it be :
> >
> > > I found the development version of PHP4 at:
> > >
> > >
> > http://www.mm4.de/andreas.otto/php_related/index.php3?wap_Session=e36ef774e8
> > 68222a85b87cef7c5370d8
> > >
> > > It has the DLL for interbase and others, I am still trying to get it to
> > work
> > > however. I can connect to an interbase DB, but my ibase_query is giving
> > me.
> > >
> > > Warning: InterBase: Dynamic SQL Error SQL error code = -104 Token
> > unknown - line
> > > 1, char 0 1 in c:\apache\htdocs/styles.php on line 12
> > >
> > > <?php
> > > $host = 'morpheus:E:\Devl\FSTEIN\DATA\Fmdata.gdb';
> > > $user = 'SYSDBA';
> > > $password = 'masterkey';
> > > $dbhandle = ibase_connect($host, $user, $password);
> > > print($dbhandle);
> > >
> > > $stmt = 'SELECT * FROM FMDATA.STYLES';
> > > $sth = ibase_query($dbhandle, $stmt);
> > > print($sth);
> > >
> > > while ($row = ibase_fetch_object($sth)) {
> > > print($row);
> > > }
> > >
> > > ibase_close($dbhandle);
> > > ?>
> > >
> > > Any ideas?
> > >
> > > --Scott
> > >
> > > Serdar Soydemir wrote:
> > >
> > > > Hi,
> > > >
> > > > As written in Windows group, PHP-4.0.2 will contain interbase.dll (and
> > many
> > > > other new dlls)
> > > >
> > > > --
> > > > Serdar
> > > > www.php.org.tr
> > > >
> > > > "Gerhard Schneider" <gs@czy.de> wrote in message
> > > > news:LPBBINCIKNEOLIIEFCIBKEALCDAA.gs@czy.de...
> > > > > Hello,
> > > > >
> > > > > does anybody outthere has this interbase dll available?
> > > > >
> > > > > Gerhard