dog199200 Posted February 3, 2010 Share Posted February 3, 2010 OK i have been working on a store system for a site of mine for a few days now and I have been working out one problems after the next and luckily I have only a few bugs left to work out and everything will work perfectly fine. One of the remaining problems is the pagination system I have setup. It works great for the most part, but when i try to call info from my database it prints it out into a single row and I honestly have no idea at all how do break it down into 3 columns of items with 3 items per column, like so: <------> 1 | 2 | 3 4 | 5 | 6 7 | 8 | 9 <------> instead its printing out like: <--------------------------------> 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 <--------------------------------> And in printing like that, it hides most of the content cause it doesn't fit within the boundaries of my site. So can someone please help me out? Here is the code I am currently use, or at least the part of it that has any relevance to the request. <?php include(CART_DIR."SimpleImage.php"); $image = new SimpleImage(); include(CART_DIR."ps_pagination.php"); echo "<table border=\"0\" cellpadding=\"20\" cellspacing=\"0\" align=center width='100%'><tr>"; $sql = 'SELECT * FROM products'; $pager = new PS_Pagination($db, $sql, 3, 5); $rs = $pager->paginate(); while($row = mysql_fetch_assoc($rs)) { $image->load(CART_DIR."gallery/$row[image].jpg"); $image->resize(100,100); $image->save(CART_DIR."gallery/$row[image]2.jpg"); list($width, $height, $type, $attr) = getimagesize(CART_DIR."gallery/$row[image].jpg"); if(preg_match("/group(4)([^\d]|$)/", $user_info['group'])) { $cost = $row[cost] - ($row[cost] * 0.10); } else { $cost = $row[cost]; } echo "<td> <img src=\"".CART_DIR."gallery/$row[image]2.jpg\" border=0> <br />Name: $row[title] <br />Type: $row[product_type] <br />Cost: <b> $cost C</b> <br /><a href=\"http://www.divineshadowsonline.com/store/includes/desc.php\" target=\"_blank\" onClick=\"window.open(this.href, this.target, 'width=300px,height=100px'); return false;\">View Description</a><br /><br /> <form method=post action=\"index.php\" name=\"frm_add_to_cart\"> <input type=hidden name=\"product_id\" value=\"$row[id]\"> <input type=hidden name=\"session_id\" value=\"$_SERVER[REMOTE_ADDR]\"> <input type=hidden name=\"title\" value=\"$row[title]\"> <input type=hidden name=\"cost\" value=\"$cost\"> <input type=hidden name=\"product_type\" value=\"$row[product_type]\">"; if($logged_in) { echo "<input type=submit value=\"Add to cart\" name=\"add_to_cart\" class=\"atc\"></form>"; echo "</td>"; } } echo "</tr></table>"; echo "<center>" . $pager->renderFullNav() . "</center>"; ?> Any help at all would be greatly appreciated, even if its giving me the general idea on how to do it. Link to comment https://forums.phpfreaks.com/topic/190785-pagination-help-should-be-simple/ Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.