Problem: Can only output one field from each array
<?php
error_reporting(0);
session_start();
include('connect.php');
ob_start();
$category = array(
"dates" => array(),
"paragraphs" => array(),
"titles" => array()
);
if ($result = $mysqli->query("SELECT * FROM tips")){
if($result->num_rows){
while($row = $result->fetch_array(MYSQLI_ASSOC)){
//printf ("%s %s %s
",$row["date"], $row["title"], $row["paragraph"]);
$dates= array($row["date"]);
$titles = array($row["title"]);
$paragraphs = array($row["paragraph"]);
}
}
$result->free();
}
?>
I want the last in the array to be displayed first so I'm using this
<?php echo $titles[count($titles)-1]?>
I think the problem is with my loop, I think its reassigning the array each time it loops round