You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
<?phpheader("Content-Type: application/json");require_once 'db.php';//Get the all response from$response = array();$statments = $connection->prepare("SELECT* FROM movies");$results= $statments->get_result();//The array stored in all results$movies = array();if ($statments->execute()){ // Get the all results form database $results =$statments->get_result(); // loop and get single row from while ($row = $results->fetch_array(MYSQLI_ASSOC)){ $movies[] = $row; } $response['error'] =false; //this is no error $response['movies'] =$movies;$response['messages'] = "Moviesreturned Successfully"; $statments->close(); }else{ $response['error'] = true;$response['messages'] = "Could Not Execute Query";}//Display Result Detailsecho json_encode($response);