Quote from: dvancouver at Jan 23, 2008, 01:31 PM
Do you mean this?
http://wiki.modxcms.com/index.php/API:DBAPI:connect
I am sorry to bump this but I am a real n00b and don’t understand how to call this through the API. This is what I have but it does not work. Thanks!
//connect to seperate mysql db
$modx->db->connect(’ip.number’, ’database_name’, ’username’, ’password’, true);
$res = $modx->db->select(’title, ExternalLink’, ’al_pages’);
while($tmp = $modx->db->getRow($res, ’assoc’))
{
//do somethign with the data
}
//disconnect
$modx->db->disconnect();
//reconnect to modx db
$modx->db->connect();
Also not sure where to put the WHERE clause (where Visible = ’1’ AND status = ’1’ order by SortOrder asc, Title asc, PageID desc)