Jump to content

Putting Product Echo and Pagination Together


justlukeyou

Recommended Posts

Hi,

 

I have a set of code which echoes content to create a product display and I have code for pagination however I am struggling to fit it together. 

 

This is the code for the I am trying to insert but it comes up with a T_STRING error.  When I use this outside the pagination code it works fine. 

 

'<div class="productimageborder"><a href="product.php?price= echo $query_row['discount'] ; </div>'

 

This is the code for the pagination

 

 

<?php

$per_page = 15;

$pages_query = mysql_query("SELECT COUNT(`description`) FROM `productdbase`");
$pages = mysql_result($pages_query, 0);
$pages = ceil(mysql_result($pages_query, 0) / $per_page);

$page = (isset($_GET['page'])) ?  (int)$_GET['page'] : 1;
$start = ($page - 1) * $per_page;

$query_string = "SELECT `description`, `price`, `awImage`, `awImage`, `discount` FROM `productdbase` LIMIT $start, $per_page";
$query = mysql_query($query_string);

while ($query_row = mysql_fetch_assoc($query)) {


echo '<p>', $query_row['description'] ,'</p>';

echo '<p>', $query_row['price'] ,'</p>';

echo '<p>', $query_row['awImage'] ,'</p>';

echo '<p>', $query_row['discount'] ,'</p>';

}

if ($pages >= 1 && $page <= $pages) {
for ($x=1; $x<=$pages; $x++) {
echo ($x == $page) ? '<strong><a href="?page='.$x.'">'.$x.'</a></strong> ' : '<a href="?page='.$x.'">'.$x.'</a> ';
}
}


?>

Hi,

 

I am struggling with adding CSS to the code.  I have the pagination and I have the code to echo everything but putting it together makes it incredibly sensitive.

 

Is there anyway to find out the right way to do.  Is there a guide to syntax which is easy to follow or does anyone know the rules to it?

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.