Quote from: eastbind at Oct 29, 2006, 10:23 AMmodx->dbはtable_prefixと全く関係なく構築されています。
なるほど、dbapi.mysql.class.inc.php を見ると仰る通りですね。
function connect ($host = '', $dbase = '', $uid = '', $pwd = '', $persist = 0) {
global $modx;
$uid = $uid ? $uid : $this->config['user'];
$pwd = $pwd ? $pwd : $this->config['pass'];
$host = $host ? $host : $this->config['host'];
$dbase = $dbase ? $dbase : $this->config['dbase'];
if (!$this->conn = ($persist ? mysql_pconnect($host, $uid, $pwd) : mysql_connect($host, $uid, $pwd))) {
$this->config[ ] は modx インストール時に生成される config.inc.php に記
録された情報を単に読み込んだだけの変数ですから、connect() の引数に自分
の使いたいデータを設定するだけですね。
納得。database api を使ってもあっさり出来そうです。