prefix bug into rawQuery
Hello I'm using prefix with my tables, and i've some problems with rawQuery
with this rawQuery
$db->rawQuery("SELECT COUNT(p.id_product) count
FROM product p
LEFT JOIN product_lang pl on pl.id_product=p.id_product WHERE `pl.id_lang` = ?", array(1));
produce this output (with error 500). And table name and fields name are replaced with prefix, but in this case only table should be replaced.
Unknown column 'p.id_**ec_**product' in 'field list' query: SELECT COUNT(p.id_ec_product) count FROM ec_product p LEFT JOIN ec_product_lang pl on pl.id_ec_product=p.id_ec_product WHERE pl.id_lang = ? (1054)
insted if i use this rawQuery (with `)
$db->rawQuery("SELECT COUNT(p.id_product) count
FROM `product` p
LEFT JOIN `product_lang` pl on `pl.id_product`=`p.id_product` WHERE `pl.id_lang` = ?", array(1));
no replace are affected, and output is
SELECT COUNT(p.id_product) count FROM product p LEFT JOIN product_lang pl on pl.id_product=p.id_product WHERE pl.id_lang = 1
how we should approach with this rawQuery?
In case you're still wondering, you've posted to the wrong project :)