I have a query which retrieves 3 columns from table which works fine in phpmyadmin
SELECT cab_id,
SUM(IF(rating=1,1,0)) as up,
SUM(IF(rating=0,1,0)) as down
FROM rating WHERE cab_id=101
table->'rating' Can anyone help me to find how I can get this query worked using redbeanphp ? I tried ,
R::getRow(),R::getAll(),R::$adapter->getAssoc()
none is working!!! To check the correctness of code I tried,
SELECT * FROM rating group by cab_id having cab_id=101
and found working.But I need the first query statement to work! Any help ,please?