On Monday 30 December 2002 18:41, Boget, Chris wrote: > > > * For PGSQL, you can get the database name, the field name > > > even the *host name* but you can't get the table name from a > > > particular query? > > > > Not sure what you're getting at here. Surely for any particular > > query, _you_ would know what table(s) is/are being used? > > That's not necessarily true. Certainly not if you are using an > abstraction layer to access the database. Take PEAR for example. > When instantiation on object, you give it the relevant connection > information (user, pw, host and perhaps a dbname that may or may > not be the dbname that gets queried later on). So sure, you can > access those member variables (except maybe dbname; I don't think > that gets stored) which is also information you can get > programatically using built in functions. But let's say you pass > a query to the query() method that doesn't use the dbname that > you used when instantiating the object. That's certainly valid. > But now, there's no way (ok, there's a way but it isn't necessarily > accurate) to get the dbname for the query that was just run... apart from > requiring the programmer to pass the dbname as another paramter > to the query() method You can do this in mysql. I just don't know > why you can't do this in pgsql.
Sorry, you've lost me. In your OP you say you wanted the "table name", but now you're talking about the "dbname"? For dbname, you can use (oddly enough) pg_dbname(). -- Jason Wong -> Gremlins Associates -> www.gremlins.biz Open Source Software Systems Integrators * Web Design & Hosting * Internet & Intranet Applications Development * /* [Babe] Ruth made a big mistake when he gave up pitching. -- Tris Speaker, 1921 */ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php