F, I'm just a dumb C-programmer (emphasis on dumb), but I think you are "wasting" a fetch of the Picture 6 data at the entry to the while loop before your final end of row check (if counter == limit) takes place within the loop. You read the data but then your limit check kicks in, starts a new row, and resets the counter before anything is done with that data. You then exit the while loop and reenter it, fetching Pic 7 data, which becomes the first entry in your new row.
If you change your loop to look like this.......
PHP Code:
while($row = mysql_fetch_assoc($results))
{
echo '<td><a href="' .$row[PICTURE_URL]. '" ><img src="' .$row[PICTURE_URL]. '" /></a><br>'; //Echo a link to the image, and display the image as well
echo 'Added to gallery:' .$row[PICTURE_DATE]. '</td>'; //display the dat it was added
$column_counter++; //Add one to the counter
if($column_counter == $column_limit)
{
echo '</tr><tr>'; //End current row, and start a new row
$column_counter = 0; //reset the column counter
}
}
I believe the code will produce the desired results. Please, all html/php junkies, confirm this.