$leadersql = "SELECT * FROM `mytable`"; $result = mysql_query($leadersql); while ($row = mysql_fetch_array($result)) { echo "hello"; };
Revo uses xPDO, and extension of PDO. A PDO connection is not the same a raw mysql connection (they use different drivers); you cannot mix PDO requests and raw mysql requests in the same connection.
http://rtfm.modx.com/display/xPDO20/Retrieving+Objects
I think that would make things worse, not better. Try RowBoat.
The best option, in terms of speed, would be to convert your table(s) to xPDO and use Revolution's built-in xPDO methods to access them: http://bobsguides.com/custom-db-tables.html. You'd have to learn xPDO, but it's very easy to work with once you get used to it (and there are a lot of other things you can do with it in MODX Revolution).
------------------------------------------------------------------------------------------
PLEASE, PLEASE specify the version of MODX you are using.
MODX info for everyone: http://bobsguides.com/modx.html
You can create your own connection to the database using mysql_connect.
Rowboat is nice, but of course being extremely flexible and generic can't quite match the performance of a custom-crafted query for specific data.
However, you'd be missing out on the power and ease-of-use (in the long run) of xPDO. It's well worth taking a few minutes and going through something like Bob's tutorial http://bobsguides.com/custom-db-tables.html