I'm able to get the response from MySQL server, but I can't seem to put it in a variable
$filmNameList2 = [];
require('connect.php');
$query = "SELECT `title`,`year` FROM `filmList` WHERE year=' (2019)'";
$result = mysqli_query($connect, $query) or die(mysqli_error($connect));
$json_array = array();
while($row=mysqli_fetch_array($result))
{
$json_array[] = $row;
// print_r($row); outputs Array ( [0] => Abruptio [title] => Abruptio [1] => (2019) [year] => (2019) )
}
$filmNameList2[] = $json_array->array[0]->array[0]->title;
// I have tried json_array->array[0]->title; json_array->title;
print_r($filmNameList2);
result that I get :
Array ( [0] => )