Den søn. 24. mar. 2019 kl. 03.11 skrev Lester Caine <les...@lsces.co.uk>:
>
> (Neely forgot to fix reply address!)
>
> On 24/03/2019 00:22, Kalle Sommer Nielsen wrote:
> > mysql_connect('localhost', 'user', 'password');
> > mysql_select_db('test'); // The last created connection is implicitly added 
> > here
>
> This situation never exists in Firebird or Interbase. The ONLY way to
> connect is to a database, you can not connect to the server without
> using a database in the connection string. Each database is it's own
> file or set of files if spread across multiple disks. There is no way of
> asking a server what databases are available, you have to know
> beforehand. Although some newcomers call it a bug it's an original
> design feature.

Really Lester, really. It was a pseudo example, do I really need to be
EXPLICIT and spell everything out very specifically for you?

ibase_connect('localhost:/path/to/some/db.gdb', 'user', 'password');
ibase_query('UPDATE a_table SET a_column = 1'); // The last created
connection is implicitly added here

What happens here is that PHP retain the last connection created by
ibase_connect() and uses it as a "default" link, meaning you do not
pass a connection resource to ibase_query() afterwards.

Compare the example to:

$link = ibase_connect('localhost:/path/to/some/db.gdb', 'user', 'password');
ibase_query($link, 'UPDATE a_table SET a_column = 1'); // Explicit, as
the first parameter is a connection resource

Besides this, it has further magic behavior if the multiple
connections are created with the same credentials as one in the same
process, I'm not sure if this is fixed with Nikita's patch.

> I'll add BOOLEAN to https://phpsurgery.org/tests/ibtest.php tomorrow,
> but there are bugs in your link that don't show in the link I have been
> using :( But some of them are not bugs ...

Then use the link from the statistics page on bugs.php.net? There is
probably a fair few for PDO_Firebird too you can find on that page

-- 
regards,

Kalle Sommer Nielsen
ka...@php.net

--
PHP Internals - PHP Runtime Development Mailing List
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to