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
Hello I'm using prefix with my tables, and i've some problems with rawQuery
with this rawQuery
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 onpl.id_ec_product
=p.id_ec_product
WHEREpl.id_lang
= ? (1054)insted if i use this rawQuery (with `)
no replace are affected, and output is SELECT COUNT(p.id_product) count FROM product p LEFT JOIN
product_lang
pl onpl.id_product
=p.id_product
WHEREpl.id_lang
= 1how we should approach with this rawQuery?