Jose Luis Levieux wrote:
Hi , I'm trying to connect a ingres database using a PHP script. In this case the database is not in the same server of php. All the examples that I found using ingres_connect functios hace the database in the same server.
How can I tell PHP the address of the database ?

I have to confess I'm a Python guy not a PHP user but looking at the docs for the ingres_connect function ( http://docs.ingres.com/qs-linux/ConnectingtoIngresfromPHP ) one is supposed to treat the database name parameter as a normal Ingres database connection string, i.e. use a vnode and omit username and password parameters from the ingres_connect call and rely on the username and password specified in the vnode def.

The syntax is mentioned on the web page as normal syntax:

   [vnode_id ::]dbname [/svr_class ]

So if you had defined a vnode called myserver inside the netutil tool and wanted to connect to a database called mydb you would do something like:

   ...
   $link = ingres_connect("myserver ::mydb");
   ...

Just make sure that you can connect without error using the regular terminal monitor program first, e.g.:

   echo "\q" | sql myserver ::mydb


Hope that helps. Don't forget to check out the drivers forum too http://community.ingres.com/forums/viewforum.php?f=5

Chris


_______________________________________________
Users mailing list
[email protected]
http://lists.ingres.com/mailman/listinfo/users

Reply via email to