Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- class Category{
- /*
- * Returns an array of categories
- */
- public static function getCategoriesList(){
- $db = Db::getConnection();
- $categoryList = array();
- $result = $db->query('SELECT id, name FROM category ORDER BY sort_order ASC');
- $i = 0;
- while($row = $result->fetch()){
- $categoryList[$i]['id'] = $row['id'];
- $categoryList[$i]['name'] = $row['name'];
- $i++;
- }
- return $categoryList;
- }
- }
- ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement