Hi all,
I am using Evo 1.10.
I need to perform an sql select statement that needs to join two tables.
Is this possible to do with DBAPI select command? I could not find any examples.
Thank you
Maybe this will help
$sql= "SELECT wu.username, wua.*
FROM " . $modx->getFullTableName( "web_users" ) . " wu
INNER JOIN " . $modx->getFullTableName( "web_user_attributes" ) . " AS wua ON wua.internalKey=wu.id
WHERE wu.id='$uid'";
$row = $modx->db->getRow( $modx->db->query( $sql ) );
if( $row ){
// code here
}
I found that code being used in the weblogin snippet (which was created by coders with much more experience than myself), and it works fine for me in other applications, your mileage may vary