I need some help because my getRecipe.php is not showing the parameters or data shown like my other PHP files: getCourseType. It just appears blank and doesn't show anything in my browser.With the getRecipe.php it just display blank or nothing but I'm expecting the output like the image below for my getRecipe.php Perhaps you can modify my codes, answer it below and let me check it out if it works. Can you help me display those data of getRecipe.php from the database? thanks !
Screenshot of getCourseType(Which is working)
getRecipe.php
<?php
require_once 'include/DB_Connect.php';
$db = new Db_Connect();
$conn = $db->connect();
if(isset($_GET['recipeId'])){
$id = $_GET['recipeId'];
$result = $conn->query("SELECT * FROM recipe where id=$id");
}else{
$result = $conn->query("SELECT * FROM recipe");
}
if ($result->num_rows > 0) {
$list = array();
while($row = $result->fetch_assoc()) {
array_push($list, $row);
}
echo json_encode(array('result' => $list));
} else {
echo json_encode("no result");
}
?>
Screenshot of PHPMYADMIN Recipe
Yeah, it has data so it should display whenever I call it....

