I am trying to figure out how to have the script load the info from
the flat file into two columns. Can't seem to get there. Here is my
script..............any help appreciated.
PHP Code:
<?php
//Declare and assign variable
$pg_genre = addslashes($_GET['pg_genre']);
//
//Now open file
if(!file_exists("listing_db.txt"))
{
echo"<table width=350 align=center>";
echo"<tr>";
echo"<td class='th tc ol fw fc'>NO RECORDS AT THIS TIME</td>";
echo"<tr>";
echo"<td class='th tc ol fw fc'>CHECK BACK LATER</td>";
echo"</tr>";
echo"</table>";
exit;
}
echo"<div style=\"border:3px #ccdd88 solid; width:350px; height:500px; overflow:auto;\">";
echo"<table border=6 align=left width=325 cellpadding=2 cellspacing=2>";
echo"<tr>";
echo"<th class='th tc ol fw fc'>Welcome to DB Gallery of Fine Things</th>";
echo"</tr>";
//
$openedfile = fopen( "listing_db.txt", 'r' );
if($openedfile)
{
while (!feof( $openedfile ) )
{
$line = trim(fgets( $openedfile ));
if ( !empty( $line ) )
{
list( $genre,$entry1,$entry2, $entry3, $entry4,) = explode( "|", $line );
//////////////////////////////////
//Now check to see which ones match the link and then post them in the table
//
if($genre == $pg_genre)
{
//Only one column with four rows
echo"<tr class=>";
echo"<td class='td tc w2 fw ol ff'><img src=\"http://www.netisopen.com/db_images/$entry1\"></td>";
echo"</tr>";
echo"<tr>";
echo"<td class='td tc w2'><a href=\"http://www.netisopen.com/db_images/$entry2\" target=\"_blank\">Click for Large View</td>";
echo"</tr>";
echo"<tr>";
echo"<td class='td tc w2 fw fc'>$entry3</td>";
echo"</tr>";
echo"<tr>";
echo"<td class='td tc w2'>$entry4</td>";
echo"</tr>";
//
}
}
}
echo"</table>";
echo"</div>";
fclose( $openedfile );
}
else
{
echo"<br /><br />FILE COULD NOT BE OPENED!";
}
?>
Well, the info from the database is loaded into the table via the echo one line at a time an therefore, $entry1, $entry2, $entry3 and $entry4 are stacked one ontop of the other and then the code runs through a gain starting a new row and doing the same untill the db is at an end. This results in one column of information.
What I would like is to have two columns. Have the db info fill side by side like so
info here-----------------------------info here
2nd line info-------------------------2nd line info
3rd line info--------------------------3rd line info
**minus the ---- as that is the only way I can display the spaces here
The table would continue until the db info was exhausted.
Does that make sense? As the code stands now it looks like this