I have this script, which is displaying the information found from a DB. My goal is to have the script display two records, and then have it create a new row. However, absolutly nothing is being outputted here.
The script:
Code: Select all
<?php
$x = 0; // Used to determine if we need a new row
foreach ($query as $data) {
if ($x == 0) { echo "<tr>"; }
echo " <td><img src='" . $this->config->site_url_noindex() . "/public/uploads/" . urlencode(str_replace(' ', '_', $data['productImg'])) . "' alt='" . $data['productName'] . "' /><br /><b><a href='" . $this->config->site_url() . "/Gallery/viewProduct/" . $data['productID'] . "/'>" . $data['productName'] . "</a></b></td>";
if ($x == 2) { echo "</tr>"; }
$x++;
if ($x >= 2) {
$x = 0;
}
}
?>
Any help would be appriciated.