I'm getting posts details from 'postsTable' with php and encoding it in JSON Like this way
$result_json = mysqli_fetch_all ($result, MYSQLI_ASSOC);
echo json_encode($result_json);
each post has a unique ID
Then I have another table called 'postsLikes' I want to see how many Likes the post have using mysqli_num_rows()
But my question is how can I add the data it returns to each object in Encoded JSON ?
$query_checkup = "SELECT * FROM postsTable WHERE Post_AgeFrom < $age AND $age < Post_AgeTo AND Post_Reviewed = 1";
$result=mysqli_query($con, $query_checkup);
$result_json = mysqli_fetch_all ($result, MYSQLI_ASSOC);
echo "{\"result\":";
echo json_encode($result_json);
echo "}";