Fetch all rows from mysql to an array
i'm pretty new to web programming and programming in general.
what i want is to fetch all the rows from a selected query in an array in wich every element (, , ,...) is an associative array representing a row.
how can i do that?
is that a better method to extract rows from mysql.
here is what i have written yet but i't not working.
$sql = "SELECT Data, Readed, Title AS Title FROM news, teams, users, prepared_news WHERE news.Template_news = prepared_news.id AND news.Id_team = teams.id AND teams.Id_user = users.id AND users.id = :Id ORDER BY Data DESC LIMIT(1,10)";
$s = $connection->prepare($sql);
foreach ($s AS $row)
$news_title_array = array(
'Data_notizia' => $row['Data'],
'Readed' => $row['Readed'],
'Title' => $row['Title']