Thanks, Rob!
Here's what I am doing now. In my class constructor, I'm doing
$this->dbr =& wfGetDB( DB_SLAVE );
Then I use $this->dbr->query($sql) a lot in the methods. I'm not reseting the db at all, since it seems to work if I just give the dbname.tablename in the query. Seems to work so far...fingers crossed on getting the rest of it to work.
Best, Jim ===================================== Jim Hu Associate Professor Dept. of Biochemistry and Biophysics 2128 TAMU Texas A&M Univ. College Station, TX 77843-2128 979-862-4054
On Feb 27, 2007, at 12:33 PM, Rob Church wrote:
On 27/02/07, Jim Hu jimhu@tamu.edu wrote:
from within function "Database::select". MySQL returned error "1103: Incorrect table name 'wikibox_db.box' (jim-hus-computer.local)".
You're using one of the query builder functions, which will automatically add the database name and table prefix to the table name passed to them. This is noted in the documentation, albeit the wrong documentation - it's in the comment for Database::tableName().
To work around this, either:
- Use Database::query() directly
- Wrap the table name in `backquotes` and the database functions
won't mess with it
- How do I set the wiki to not hide the sql query from me?
$wgShowSQLErrors = true;
Rob Church
Wikitech-l mailing list Wikitech-l@lists.wikimedia.org http://lists.wikimedia.org/mailman/listinfo/wikitech-l