I’m creating an indexed array from JUST values of an associative array (fetched from a database) which I can then reassign to different variables by index
`$runSql = mysqli_query($connect, $queryTitle);
if ($runSql) {
if (mysqli_num_rows($runSql) > 0) {
$indxarrTitleResult = array();
while ($assocarrResultTitle = mysqli_fetch_assoc($runSql)) {
$indxarrTitleResult[] = $assocarrResultTitle[‘Title’];
}
print_r($indxarrTitleResult);
}
}
this produces:
Array ( [0] => Traditional Favourites [1] => Starters [2] => Mains )
but what I really want is:
Array ( “Traditional Favourites”, “Starters”, “Mains”)
what is going wrong? From the result I got, I can only assign Traditional Favourites to another variable but nothing else