This is a very common operation but I do not know why I have an array of string back.
$res=$queryHelper->ExecuteQuery("
SELECT (food.id,stores.name)
FROM food, stores
WHERE food.id_stores=stores.id");
QueryHelper Class
public function ExecuteQuery($queryRec,$executeRec=array())
{
$sql = $this->db->prepare($queryRec);
$sql->execute($executeRec);
$this->res=$sql->fetchAll();
return $this->res;
}
TABLE FOOD
id| name | id_stores
0 | PASTA | 0
1 | FISH | 0
TABLE STORES
id |name
0 | MARKET0
1 | MARKET1
$res is
Array ( [0] => Array ( [row] => (0,MARKET0) ) [1] => Array ( [row] => (1,MARKET0) ) )
but I expect
Array ( [0] => Array ( [0] => (0), [1] => ["MARKET0"] ) [1] => Array ([0] => (1), [1] => ["MARKET0"] ) )
or something like this.
If there is only one table in the query all is fine.