ZenCart has been a rewrite of OSCommerce, and is a notch above the latter in code quality and features. Database is accessed via a class (includes/classes/db/mysql/). Here's an example of how it can be used.
$db = new queryFactory();
# DB_SERVER, DB_SERVER_USERNAME etc come from includes/configure.php
$db->connect(DB_SERVER, DB_SERVER_USERNAME, DB_SERVER_PASSWORD, DB_DATABASE, USE_PCONNECT, false);