Hello, please help with the problem of writing to the data array from mysql. When outputting an array declared as a result of a sample, such duplicates are obtained from the database.
<?php $connection = mysql_connect("localhost","root",""); $db = mysql_select_db("lightside_db"); mysql_set_charset("utf8"); if(!$connection || !$db){ exit(mysql_error()); } $result = mysql_query("SELECT id, title, image, date, author FROM news ORDER BY date"); $arr = mysql_fetch_array($result); foreach ($arr as $key => $value) { echo $key." => ".$value."<br>"; } ?> 