Answer the question
In order to leave comments, you need to log in
How to display data in a loop from a database in smarty?
Hello, tell me how to display 30 records from the database in smarty?
let's say I have 100 records in the database, I need to select 30 records in which the category_id=9 column,
I understand that such a query can be made
function minListUsersViwed() {
global $db;
$category_9=$db->fetchRow("select `category_id` from ".TABLE_ADS." where `category_id`=9 ORDER BY `date_added` ASC LIMIT 30");
if(!$category_9) return 0;
return $category_9;
}
$category_9 = $listings->minListUsersViwed($category_9);
$smarty->assign("category_9",$category_9);
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question