2009年4月2日星期四

Re: [fw-db] select->from($table...) has a different schema from the default db adapter's

sri2php wrote:
>
> $tableObj = new $table;
> $select = $tableObj->select();
> $select = $select->from($table, array("$attributeName"))
> ->where("$attributeId = '$id'");
>
> However, $table->_schema is different from default db set in the default
> db adapter.
> How can we force the generated SELECT statements to have schemas prepended
> to their table names?
>
>

The right way to do this would be to create a db adapter on the fly that
uses your specific schema, and pass it to your table object whenever you
need to connect to that schema. Trying to change it at the Table's level
would be a dirty patch in my opinion.
--
View this message in context: http://www.nabble.com/select-%3Efrom%28%24table...%29-has-a-different-schema-from-the-default-db-adapter%27s-tp22829446p22851328.html
Sent from the Zend DB mailing list archive at Nabble.com.

没有评论: