I"m trying to make a catelogue page and its slowly comming along but i can't get it theway i want it.
at the moment teh script i have so far come up with(borrowed)
just display to bit of informaiton for the one product in 2 coloums side by side what i'm trying to come up with is like the diagram below
IIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIII
III iTEM id (1)IIII PRO NAME II II ITEM ID (2) IIII pRODUCT II
III IIII II II IIII NAME III
IIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIII
III IIII II II IIII IIII
III PICTURE IIII pRICE II II pICTUE IIII pRICE IIII
IIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIII
SIMILR to that
i code i have done is here o rin the file
<?php
// set teh number of colums
$columns = 2;
// create connection
$username = "";
$password = "";
$server = "";
$db_name = "ahc";
$connection = mysql_connect ("$server","$username", "$password") or die ("couldn't connect to Server.");
//select database
$db = mysql_select_db("$db_name", $connection) or die ("Couldn't select databse.");
//create the sql statement
$query = "select pro_name, pro_image
from example";
$result = mysql_query($query);
// we add this line because we need to know the number of rows
$num_rows = mysql_num_rows($result);
$rows = ceil($num_rows / $columns);
//first array
while($row = mysql_fetch_array($result)) {
$data[] = $row['pro_name'];
//store other fileds into the array
$data2[] = $row['pro_image'];
}
echo "<table width=\"500\" height=\"100\" border=\"1\" align=\"center\">\n";
for($i = 0; $i < $rows; $i++) {
echo "<TR>\n";
for ($j = 0; $j < $columns; $j++) {
if(isset($data[$i + ($j * $rows)])) {
echo "<td></td><td>" ."<img src=db_images/" . $data2[$i + ($j * $rows)] . ">" . "</td>\n";
//ECHO OUT HTE FILED
echo "<td>" . $data[$i + ($j * $rows)] . "</td>\n";
}
}
echo "</TR> <tr><td height=\"23\"> </td> </tr> \n";
}
echo "</table>\n";
?>
I HOPE SOME ONE CAN HELP ME OUT WITH THIS AS IT IS IMPORTANT.