Why do these values not display the same way every time?
The page in question is https://www.countryshowdown.com/new_map.php. When you pass your mouse over Nevada, you'll get a list of four radio stations. The problem is the way in which they're displayed. Instead of there being another station displayed to the right of KJRC, there's a blank cell. Now hover over Oklahoma. Perfect! No empty cells. Why do I have an empty cell over Nevada? You see the same thing in North Carolina.
I've gone out to the database and there's nothing obvious there, as far as a flaw in the data. There's just something about the way those two queries are running where I'm getting a cell and then a </tr></tr>.
Here's my code:
$allie = "select station_name from dbo_radio_stations where state_id='$bruce_row[state_id]'"; $allie_query=mysqli_query($cxn, $allie); if(!$allie_query) { $whatever=mysqli_errno($cxn).': '.mysqli_error($cxn); die($whatever); $count++; // increment count } ?><table style='width:100px; border-spacing: 1px; border-collapse: separate;'><tr><?php while($allie_row=mysqli_fetch_assoc($allie_query)){$count++; // increment countextract($allie_row);?><td class='station'><?php echo stripslashes($allie_row['station_name']);?></td><?php if ($count % $maxcols == 0) { // if modulus of count is = 0 then end row echo "</tr><tr>"; }}if ($count) { // data exists $fill = ($count % $maxcols); // current column if ($fill){ // if not last column already fill in blank columns for ($i = $fill; $i <= ($maxcols -1); $i++){ echo "<td> </td>"; } echo "</tr>"; } echo "</table>"; }?>
It is. But you made me just think of something. The $count is is defined at the top of the page. Is it possible that after each iteration of the code, I need to reset the count? I'm smelling there, Gary, what do you think?
Gary
Me thinks you've hit the nail on the head - the echo would show the counter is not what it should be.
<tr><td class='station'>KRJC</td><
KRJC is on its own row then you start a new row with KOWA