Before PHP 8 my website was working as expected. After PHP 8 my website had a few minor bugs in it. And since I"m new, I'm wondering if someone from here can help me out. I have the database open 🙂. Now what I would like to do is going into a table and check if the table has any information in it. If it doesn't have any information, to print "No Information Found" and move on to the next coding. If there is information there, please print it in a while loop.
The coding I have is following:
Thank you for your help in advance.
The coding I have is following:
PHP:
$Query = "Select id from ticketinfo where box1 = '' ";
if($result = mysql_query($Query)) {
if ( mysql_num_rows($result) == 0 ) {
echo "No Information Found";
}
if($stmt = $mysqli->query("SELECT box1, FROM ticketinfo WHERE username = '$username' ORDER BY drawingdate")){
echo "<table border='1'>
<tr>
<th>Box #1</th>
</tr>";
while ($row = $stmt->fetch_assoc()) {
echo "<tr>";
echo '<td align="center">' . $row['box1'] . "</td>";
echo "</tr>";
}
}
Last edited by a moderator: