hello guys,
i develop an eshop from scratch, i want when a user choose the category he wants then the products per row he can see its not a static number, for example 3 items per row
i want admin to give for example this : 2;3;4; so thats means : the first row has 2 items, the second 3 items and the third 4 items
how can i manage this?
thats the code i developed :
$productsPerRow = 3;
$productsPerPage = 100;
$sql = “SELECT* from tbl_product order by pd_id desc”;
$result = dbQuery(getPagingQuery($sql, $productsPerPage));
$pagingLink = getPagingLink($sql, $productsPerPage, “c=$catId”);
$numProduct = dbNumRows($result);
if ($numProduct > 0 ) {
$i = 0;
while ($row = dbFetchAssoc($result)) {
extract($row);
if ($pd_thumbnail) {
$pd_thumbnail = WEB_ROOT . ‘images/product/’ . $pd_thumbnail;
} else {
$pd_thumbnail = WEB_ROOT . ‘images/no-image-small.png’;
}
if ($i % $productsPerRow == 0) {
echo ‘
}
?>