Hi Guys
What I am trying to do is allow a 3 x 3 grid of images and then have bottom navigation.
You can see the existing layout at http://areabulgaria.net/properties.php
Here is the code to where I am so far, since I'm no real programmer, its giving me a headache. Could anyone help me to achieve the result please.
Regards
FJW
Function output_array2(){
//data is available to here from normal listing, i.e one record under the other
$query = "SELECT * FROM Garant";
$result = mysql_query($query);
if (!$result) {
echo "Could not successfully run query ($sql) from DB: " . mysql_error();
exit;
}
if (mysql_num_rows($result) == 0) {
echo "No rows found, nothing to print so am exiting";
exit;
}
if($count = mysql_num_rows($result) > 0) {
$result2 = mysql_query($query);
$row = mysql_fetch_array($result2);
$numrows = $row['count'];
echo "<a href=\"" . $PHP_SELF . "?start=" . ($start - 9) . "\">Previous</a>\n";
if($numrows > ($start + 9))
{
echo "<a href=\"" . $PHP_SELF . "?start=" . ($start + 9) . "\">Next</a>\n";
}
$max=3; $count=mysql_num_rows($result); //set the number of images across here
echo "<table border =1><tr>";
for($i=0;$i<$max;$i++)
{
// echo "<td>Column $i+1</td>";
}
echo "</tr>\n";
{
$headings = $pics = $locations = '<tr>';
for($j=0;$j<$max;$j++)
{
if($images = mysql_fetch_assoc($result))
{
$pics .="<TD bgcolor=\"#FFFFFF\" width=\"125\" ><A HREF=\"details.php?detail=".$images["id"]." \"><IMG SRC=\"resources/".$images["smallpic"]."\"></A></TD>";
$locations .= '<td align="center" bgcolor=#DDEEFF><B>' .$images['Price']. ' Euro - - REF - ' .$images['id'].'</B></td>';
} else {
$headings .= '<td> </td>';
$pics .= '<td> </td>';
$locations .= '<td> </td>';
}
}
$headings .= "</tr>\n";
$pics .= "</tr>\n";
$locations .= "</tr>";
echo $headings;
echo $pics;
echo $locations;
}
echo '</table>';
}
}