I retrieved REST API from MySQL but look appears disgusting in Postman and uncomfortable for the following use.
I just begin to study PHP and can to a little bit.
My code:
<?php
$connect = mysqli_connect("localhost", "***", "***", "***");
$sql = "SELECT `id_question`, `question`, `opt_asnwer_1`, `opt_asnwer_2`, `opt_asnwer_3`, `opt_asnwer_4`, `right_answer` FROM `questions`";
$result = mysqli_query($connect, $sql);
$json_array = array();
while($row = mysqli_fetch_assoc($result))
{
$json_array[] = $row;
}
echo json_encode($json_array);
?>
What look which I want to make. Example:
Please help me.