I am having the same problem however if i run my sql code on the DB it works.
<!DOCTYPE html>
<!--
To change this license header, choose License Headers in Project Properties.
To change this template file, choose Tools | Templates
and open the template in the editor.
-->
<html>
<head>
<meta charset="UTF-8">
<title></title>
</head>
<body>
<?php
// put your code here
$user_name= "11";
$conn = mysqli_connect('localhost', "root", "", "Invoices");
if (!$conn){
echo "Cannot find database";
}
else {
$mysql1 = "SELECT `Invoice_ID`, `Served_by`, `Date_served`, `Time_served`, `Cost` FROM `payment` WHERE `Invoice_ID` like '.$user_name''";
$result = mysqli_query($conn, $mysql1);
mysqli_store_result($conn);
$numrows = mysqli_num_rows($result);
}
if ($numrows > 0) {
echo "Login succesful";
}
else {
echo "User not found or invalid credentials";
}
?>
</body>
</html>