I needed to change a query into a JOIN of two tables.
$q = "SELECT * FROM table1 AS a JOIN table2 AS b USING(id) WHERE a.id= $id";
$stmt = db::getInstance()->prepare($sql);
return $stmt->fetchAll(PDO::FETCH_ASSOC);
All off the sudden I cannot refer to each row value with $rows['value']
,BUT I need to use $rows[0]['value']
.
How can I avoid this behavior and get the values in the row without using [0]?
Thanks, Richard