So, I want to show a js alert to the user if they exist in a table called paymentindue. The table has a custom message column. I want the alert to show the custom message. I am using PHP to handle sql queries
<?php
include 'dbconn.php';
$name = $_SESSION['name'];
$email = $_SESSION['email'];
$sql = "SELECT * FROM users where email='$email' AND username = '$name'";
$result = mysqli_query($conn, $sql);
if (mysqli_num_rows($result) > 0){
echo '<script>alert("<?php Custom message goes here?>")</script>';
}
?>
But the problem is that I get the alert instead of the custom message