Jump to content

In model page MYSQL COUNT query is not working properly


Recommended Posts

$result2 = Db::getInstance(_PS_USE_SQL_SLAVE_)->ExecuteS('SELECT COUNT('._DB_PREFIX_.'order_detail.`product_id`) AS id FROM `'._DB_PREFIX_.'order_detail` WHERE '._DB_PREFIX_.'order_detail.`product_id`=14');
        for ($z = 0; $z < count($result2); $z++){
        echo "test".$result2['id'];
        }

 

the echo dosen't show any result

 

Please help

Link to comment
Share on other sites

×
×
  • Create New...