Using GalleryConnection but selecting different tables with different prefix.


Joined: 2003-09-10
Posts: 49
Posted: Thu, 2007-08-16 14:41


Im using wordpress and gallery in one database. And I'm planning to create a php script that will select between the tables of wordpress and gallery. And im thinking of using the DB connection of gallery..

$storage =& $gallery->getStorage();

is this possible? Can I select data from wordpress table (with different prefix from gallery table) using this connection.? Are there any other work-around on this?



Gallery version (not just "2"): 2.2.1
PHP version (e.g. 4.3.11): 4.3.11
PHPInfo Link (see FAQ):
Webserver (e.g. Apache 1.3.33): 1.3.33
Database (e.g. MySql 4.0.11): 4.0.11
Activated toolkits (e.g. NetPbm, GD):
Operating system (e.g. Linux): Linux
Browser (e.g. Firefox 1.0): firefox 1.5

mindless's picture

Joined: 2004-01-04
Posts: 8601
Posted: Wed, 2007-08-22 21:19

I think it's ok... if you use $gallery->search or $storage->execute then use the gallery syntax for gallery tables (like [GalleryItem] or [GalleryEntity::id]) but use the actual table/column names for wordpress tables.