Kod
$type = $_GET['type'];
//Pokazuje wszystkie
if(empty($_GET['type'])){
$galery_query=$db->query('SELECT * FROM '.DB_PREFIX.'galery ORDER BY id desc LIMIT '.intval($i).',20');
}
//Pokazuje po typie
elseif(!empty($_GET['type'])){
$galery_query=$db->query('SELECT * FROM '.DB_PREFIX.'galery WHERE `type` = '.$type.' ORDER BY id desc LIMIT '.intval($i).',20');
}
//Pokazuje wszystkie
if(empty($_GET['type'])){
$galery_query=$db->query('SELECT * FROM '.DB_PREFIX.'galery ORDER BY id desc LIMIT '.intval($i).',20');
}
//Pokazuje po typie
elseif(!empty($_GET['type'])){
$galery_query=$db->query('SELECT * FROM '.DB_PREFIX.'galery WHERE `type` = '.$type.' ORDER BY id desc LIMIT '.intval($i).',20');
}
opis błędu
Gdy klikam na link strona.pl/galeria.php jest wszystko OK
lecz gdy klikam na strona.pl/galeria.php?type=cos wyrzuca mi blad:
unknown column 'cos' in 'where clause'
SELECT * FROM strefa_galery WHERE `type` = cos ORDER BY id desc LIMIT 0,20
czy mógł by mi ktoś pomóc