hi all
my code is as shows
<?php
// we are going to use two variables here, 'phone' to get the manufacturer and 'model' which will search by model.
$phone = $_POST['phone'];
if(!$phone){
//this goes in the head of the document
// use a database connection as in the download script
include 'config.php';
//in the head replacing everything except the dbase connection
mysql_select_db($dbname);
$maxRows_test = 6; // number of products to return
$pageNum_test = 0; // page number
if (isset($_GET['p'])) {
$pageNum_test = $_GET['p'];
}
$startRow_test = $pageNum_test * $maxRows_test;
$colname_test = "-1";
if (isset($_GET['phone'])) {
$colname_test = $_GET['phone'];
}
mysql_select_db($dbname);
$query_test ="SELECT * FROM product WHERE `merchant_category` LIKE '%".$colname_test . "%' LIMIT ".$startRow_test.",".$maxRows_test;
$test = mysql_query($query_test) or die(mysql_error()); $row_test =
mysql_fetch_assoc($test);
if (isset($_GET['t'])) {
$totalRows_test = $_GET['t']; } else {
$query_test2 ="SELECT * FROM product WHERE `merchant_category` LIKE '%".$colname_test . "%' ORDER BY price DESC";
$all_test = mysql_query($query_test2);
$totalRows_test = mysql_num_rows($all_test);
}
$totalPages_test = ceil($totalRows_test/$maxRows_test)-1;
$queryString_test = "";
if (!empty($_SERVER['QUERY_STRING'])) {
$params = explode("&", $_SERVER['QUERY_STRING']);
$newParams = array();
foreach ($params as $param) {
if (stristr($param, "p") == false &&
stristr($param, "t") == false) {
array_push($newParams, $param);
}
}
if (count($newParams) != 0) {
$queryString_test = "&" . htmlentities(implode("&", $newParams));
}
}
$queryString_test = sprintf("&t=%d%s", $totalRows_test, $queryString_test);
?>
<?php
$test_endRow = 0;
$test_columns = 2; // number of columns change this if you want 2 or 4 or whatever
$test_hloopRow1 = 0; // first row flag
do {
if($test_endRow == 0 && $test_hloopRow1++ != 0) echo "<tr>";
?>
<td>
<p><img src="<?php echo
$row_test['image_url']; ?>" height="100" width="80" style="float:left; margin:6px;" alt="" /><br />
<?php echo $row_test['product_name']; ?><br /> @ £<?php echo number_format($row_test['price'],2,'.',','); ?><br />
<strong>Trade</strong> <a href="outgoing.php?link=<?php echo
$row_test['deeplink']; ?>?&emailaddress=<?php $emailaddress = $_GET['emailaddress']; echo $emailaddress;?>" onClick="alert('You are now entering our Partner site');return true">Click Here</a>
<br><?php echo $row_test['program_name']; ?></td><br /><br /><br />
<?php $test_endRow++;
if($test_endRow >= $test_columns) {
?>
</tr>
<?php
$test_endRow = 0;
}
} while ($row_test = mysql_fetch_assoc($test)); if($test_endRow != 0) {
while ($test_endRow < $test_columns) {
echo("<td> </td>");
$test_endRow++;
}
echo("</tr>");
}?>
</table>
<tr>
<td><?php if ($pageNum_test > 0) { // Show if not first page ?>
<a href="<?php printf("%s?p=%d%s", $currentPage, 0,
$queryString_test); ?>">First</a>
<?php } // Show if not first page ?>
</td>
<td><?php if ($pageNum_test > 0) { // Show if not first page ?>
<a href="<?php printf("%s?p=%d%s", $currentPage, max(0,
$pageNum_test - 1), $queryString_test); ?>&phone=<?php $phone=$_GET['phone']; echo $phone;?>">Previous</a>
<?php } // Show if not first page ?>
</td>
<td><?php if ($pageNum_test < $totalPages_test) { // Show if not last
page ?>
<a href="<?php printf("%s?p=%d%s", $currentPage,
min($totalPages_test, $pageNum_test + 1), $queryString_test); ?>&phone=<?php $phone=$_GET['phone']; echo $phone;?>">Next</a>
<?php } // Show if not last page ?>
</td>
<td><?php if ($pageNum_test < $totalPages_test) { // Show if not last
page ?>
<a href="<?php printf("%s?p=%d%s", $currentPage, $totalPages_test,
$queryString_test); ?>">Last</a>
<?php } // Show if not last page
} else {
echo "empty";
}
?>
I have the results displayed
result 1
result 2
result 3 etc
what im looking to do is
result 1 | result 2 | result 3
etc
been hunting the forums but a bit confused
david