I used it pretty much exactly as the great pbmods gave it:
[php]
// mysql connection and select database...
$_result = mysql_query("
SELECT
`url_short`
FROM
`mahcuz_pics`";
/*
- url_short is the row in which a relative url is held of the uploaded photo
- mahcuz_pics is the table
*/
echo '<table>'; // start the table.
$_counter = -1; // We start 'outside' the Matrix. Unlike Neo.
$_cols = 3; // 3 columns. Of the Ionic variety.
while($_row = mysql_fetch_array($_result)){ //get array of table.
// Advance the counter and determine our 'position';
$_pos = ( ++$_counter % $_cols );
// Should we output a '<tr>'?
if( $_pos === 0 )
{
echo '<tr>';
}
// Output the URL.
echo "
<td>
<a href=\"../../upload/viewer.php?ID={$row['url_short']}\" target=\"_blank\">
<img src=\"../../upload/imgsize.php?w=170&h=130&img=../uploads/{$row['url_short']}\" />
</a>
</td>"; // echoing out the image
// Should we output a '</tr>'?
if( $_pos === $_cols - 1 )
{
echo '</tr>';
}
}
if( $_counter % $_cols !== $_cols - 1 )
{
do
{
echo '<td style="visibility: hidden"> </td>';
}
while( ++$_counter % $_cols !== $_cols - 1 );
echo '</tr>';
}
echo '
</table>';
[/php]
Ok so now I am stuck with 1 final thing. I cant seem to work the code so that each picture has captions above it. The caption would be a text string that says 'Photo Identification' and then displays their last name. this is what i have
[php]
<?
include_once('../sql_connect.php');
$result = mysql_query("SELECT A.LastName, A.FirstName, A.Server, A.TimeIn, A.TimeOut, B.image FROM nocsis A, image B WHERE A.LastName = B.LastName AND A.TimeOut IS NULL ORDER BY A.TimeIn DESC");
{//begin of loop
//now print the results:
echo '<table>'; // start the table.
$_counter = -1; // We start 'outside' the Matrix. Unlike Neo.
$_cols = 5; // 3 columns. Of the Ionic variety.
while($myrow = mysql_fetch_array($result)){ //get array of table.
// Advance the counter and determine our 'position';
$_pos = ( ++$_counter % $_cols );
// Should we output a '<tr>'?
if( $_pos === 0 )
{
echo '<tr>';
}
echo "
<td>
<img src=\"" . $myrow['image']."\" />
</a>
</td>"; // echoing out the image
// Should we output a '</tr>'?
if( $_pos === $_cols - 1 )
{
echo '</tr>';
}
}
if( $_counter % $_cols !== $_cols - 1 )
{
do
{
echo '<td style="visibility: hidden"> </td>';
}
while( ++$_counter % $_cols !== $_cols - 1 );
echo '</tr>';
}
echo '
</table>';
} //end of loop
?>
[/php]
and i want to include something like
[php]
echo "<b><u> Photo Identification</b></u> ";
echo "<br>Last Name: ";
echo $myrow['LastName'];
echo "<br></br>";
echo "</i><hr align=left width=160>";
echo $myrow['text1'];
[/php]
any ideas??