Hey guys I'm back and I feel like I'm making a really stupid error in my code but I can't seem to find it. What I am trying to do is split data retrieved from a mysql table into two columns inside an html table. So far I got it working...sort of. The problem I am having is the data keeps replicating to both rows in the table versus being an individual entry in each cell. I have used googled and searched these forms and can't seem to see where I am making the error. Below is the code
// Build the table
echo '
<table>
<tr>
';
// Build the headers
for ($x = '1'; $x <= '2'; $x++)
echo '
<td>Truck</td>
<td>Home Base</td>
<td>Client</td>
<td>Job Details</td>
<td>Crew</td>
';
// Close off headers
echo '</tr>';
// Fetch the table contents if the rigs are active
while($row = mysqli_fetch_array($truck_full_query)) {
for ($y = '1'; $y <= '1'; $y++):
echo '<tr>';
for ($z = '1'; $z <= '2'; $z++):
echo '<td>' . $row['model'] . ' #' . $row['position'] . '<br>' . $row['unit_number'] . '</td>';
echo '<td>' . $row['dispatch_location'] . '</td>';
// Get client information
echo '<td> </td>';
// Get Job Details
echo '<td> </td>';
// Get Crew
echo '<td> </td>';
endfor;
echo '</tr>';
endfor;
}
// Close table
echo '</table>';
for ($y = '1'; $y <= '1'; $y++):what's this for?for($y = '1'; $<= '1'...)`. for loops work on integers, not strings. and whye ven bother with a loop when you're only doing a SINGLE iteration?$y = '1'from? i would actually be interested in looking at the rest of the code there.