public static function getCategory()
{
$query = "SELECT * FROM `categories` ORDER BY `position`";
$result = DB::query(Database::SELECT, $query)->execute();
$data = [];
while ($row = $result->current()) {
$data[$row["parent_id"]][] = $row;
$result->next();
}
return $data;
}
public static function getCategory()
{
$query = DB::query(Database::SELECT, "SELECT * FROM categories ORDER BY position");
$row = $query->execute()->as_array();
$result = array();
foreach ($result as $row)
{
$result[$row["parent_id"]][] = $row;
}
return $result;
}
public static function getCategory()
{
$query = mysqli_query("SELECT * FROM `categories` ORDER BY `position`");
$result = array();
while ($row = mysqli_fetch_array($query))
{
$result[$row["parent_id"]][] = $row;
}
return $result;
}