I made this to display data but nothing appeared, and it shows no errors in coding
is there anyone who can help me
<?php
require 'db_connect.php';
$sql_get = "SELECT * FROM daftarumkm ORDER BY id_daftar DESC";
$query = $con->query($sql_get);
$response_data = null;
while ($data = $query->fetch_assoc()) {
$response_data[] = $data;
}
if (is_null($response_data)) {
$status = true;
} else {
$status = true;
}
and this is db_connect.php
<?php
define('DB_USER', "root"); // db user
define('DB_PASSWORD', ""); // db password (mention your db password here)
define('DB_DATABASE', "data_umkm"); // database name
define('DB_SERVER', "localhost"); // db server
$con = mysqli_connect(DB_SERVER,DB_USER,DB_PASSWORD,DB_DATABASE);
// Check connection
if(mysqli_connect_errno())
{
echo "Failed to connect to MySQL: " . mysqli_connect_error();
}
?>