如何在CS CART中创建和执行SQL查询?

Just want to ask how can I create a simple query using CSCART?

I have this query in my code but it doesn't display my query result. Here's my code:

$company_list = db_query('SELECT company FROM cscart_companies ORDER BY company LIMIT 100');

fn_print_r($company_list);

foreach($company_list as $t){
    echo $t['company'];
}

But it only display the value from my print_r() which is:

mysqli_result Object
(
    [current_field] => 0
    [field_count] => 1
    [lengths] => 
    [num_rows] => 100
    [type] => 0
)

You need to use

$company_list = db_get_array('SELECT company FROM ?:companies ORDER BY company LIMIT 100');
foreach($company_list as $t){
    echo $t['company'];
}

For me works this:

$company_list = db_get_array('SELECT company FROM ?:companies ORDER BY company LIMIT 100');
foreach ($company_list as $t){
   foreach ($t as $r) {
     echo $r['company'];
   }
}