GROUP_CONCAT
The MySQL
$sql = 'select GROUP_CONCAT(id_product_attribute) as ids FROM `'._DB_PREFIX_.'product_attribute` where id_product='.$id_product.' ';
$result = Db::getInstance()->getValue($sq);
Output
10,11,12,13,14,15
GROUP_CONCAT
function concatenates strings from a group into a single string with various options.$sql = 'select GROUP_CONCAT(id_product_attribute) as ids FROM `'._DB_PREFIX_.'product_attribute` where id_product='.$id_product.' ';
$result = Db::getInstance()->getValue($sq);
Output
10,11,12,13,14,15
Comments
Post a Comment