using adodb in UDT to query another database [SOLVED]
Posted: Tue Nov 05, 2013 11:00 pm
I'm in the process of updating old UDTs that use mysql_xxx functions. I found many examples that showed how to query the CMSMS database. however, I need to query another database.
so far i got:
which is fine, but i cannot use the FetchRow() method
it appears that i can only use adodb lite functions, but
gives me access to more functions. i managed to retrieve single records using GetRows() or GetAll(). however, I assume even that is done incorrectly, as my field is returned in $row[0]['field'] and not $row['field']. is this to be expected?
but more importantly, what is the correct way to loop through while condition? or how do i extend the library and include what i believe is called "pear" in cmsms UDT? if you know of a beginner's manual / tutorial site, a link would be much appreciated.
Thanks,
so far i got:
Code: Select all
require "ms_config/db.php";
//connect - using ADOdb lite syntax
$db = NewADOConnection('mysql');
$db->Connect($db_host,$db_user,$db_pw,$db_db);
$query1 = "SELECT * FROM sometable";
$result1 = $db->Execute($query1);
Code: Select all
while ($result1 && $row = $result1->FetchRow())
Code: Select all
$db = cmsms()->GetDb
but more importantly, what is the correct way to loop through while condition? or how do i extend the library and include what i believe is called "pear" in cmsms UDT? if you know of a beginner's manual / tutorial site, a link would be much appreciated.
Thanks,