Foreach $item is not displaying

jonas1045

New Member
Having trouble using foreach to output the contents of a mysql table. The table (tr, td) etc is being printed out for each entry in the mysql table, but there is nothing between the td and /td tags, where each $item should be echoed.\[code\]$sql = 'SELECT domain FROM domainsuggestions'; $domains = mysqli_query($link, $sql); // get domain suggestions from table<table> <tr> <td>Domain Suggestions</td> </tr> <?php foreach ($domains as $item): ?> <tr> <td><?php echo htmlspecialchars($item, ENT_QUOTES, 'UTF-8'); ?></td> </tr> <?php endforeach; ?></table>\[/code\]
 
Back
Top