Jump to content

[SOLVED] Products in list to start on new line


mikebyrne

Recommended Posts

At present my products are listed one after the other with the code below. How can I make sure the next product starts on a new line??

 

The last vaible to be displayed for each product is Price

 

 

<?php

if (isset($_POST['searchme'])) {

include("adminconnect.php");

$tbl_name = "product";

$cat = mysql_real_escape_string($_POST['cat']);
$input =mysql_real_escape_string($_POST['searchfield']);

$query = "SELECT * FROM product WHERE Producttype = '$cat' AND Productname LIKE '%$input%'";

$result = mysql_query($query) or die ("error in the query" . mysql_error());
  if (mysql_num_rows($result) > 0) {
    while($row = mysql_fetch_array($result)) {
    echo "Title <a href=\"product.php?id=".$row['ProductNo']."\">".$row['ProductName']."\n<br> Price ".$row['Price']."";
    }
  } else {
  echo "No search results found";
  }
} else {
    echo "No search terms entered.";
}

?>    

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.