DATABASE ERROR: SELECT id, title, NSLevel, seolink, url FROM cms_category WHERE NSLeft <= AND NSRight >= AND parent_id > 0 ORDER BY NSLeft You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'AND NSRight >= AND parent_id > 0 ORDER BY NSLeft' at line 3
public function getCategoryPath($left_key, $right_key) { $sql = "SELECT id, title, NSLevel, seolink, url FROM cms_category WHERE NSLeft <= $left_key AND NSRight >= $right_key AND parent_id > 0 ORDER BY NSLeft"; $result = $this->inDB->query($sql); if (!$this->inDB->num_rows($result)) { return false; } while($cat = $this->inDB->fetch_assoc($result)){ $path[] = $cat; } return $path; }
P.S. Почему хочу компонентом, а не модулем? — Педжинг (пагинация) страниц чтобы была не на javascript.