Select * from catalog_photo where idt= order by tomain desc, id asc limit 1
You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'order by tomain desc, id asc limit 1' at line 1
Товар не найден

Под заказ

Доставка до дома
от 1 дня
Заберу сам
СЕГОДНЯ

г. Петрозаводск

Select catalog_stores.id, catalog_stores.geopoint, catalog_stores.title, catalog_stores.timetable, catalog_rests.count from catalog_rests, catalog_stores where catalog_rests.idc= and catalog_stores.id=catalog_rests.ids and catalog_stores.hide=0 and catalog_rests.count>0 order by catalog_stores.pos asc
You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'and catalog_stores.id=catalog_rests.ids and catalog_stores.hide=0 and catalog_re' at line 1
Описание
Select catalog.*, (Select catalog_category.alias from catalog_category where catalog_category.id=catalog.cat limit 1) as catalias, (Select catalog_category.name from catalog_category where catalog_category.id=catalog.cat limit 1) as cattitle, (Select catalog_photo.fname from catalog_photo where catalog_photo.idt=catalog.id order by tomain desc limit 1) as photo from catalog where catalog.hide=0 and catalog.cost>0 and catalog.flag_sync=0 and catalog.cat=23349 and catalog.id!= order by rand() limit 15
You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'order by rand() limit 15' at line 5
Select catalog.*, (Select catalog_category.alias from catalog_category where catalog_category.id=catalog.cat limit 1) as catalias, (Select catalog_category.name from catalog_category where catalog_category.id=catalog.cat limit 1) as cattitle, (Select catalog_photo.fname from catalog_photo where catalog_photo.idt=catalog.id order by tomain desc limit 1) as photo from catalog where catalog.hide=0 and catalog.cost>0 and catalog.flag_sync=0 and catalog.id!= and catalog.cat in (SELECT t0.id FROM catalog_category t0 WHERE id = 23348 UNION ALL SELECT t1.id FROM catalog_category AS n0 INNER JOIN catalog_category AS t1 ON n0.id = t1.up WHERE n0.id = 23348 UNION ALL SELECT t2.id FROM catalog_category AS n0 INNER JOIN catalog_category AS t1 ON n0.id = t1.up INNER JOIN catalog_category AS t2 ON t1.id = t2.up WHERE n0.id = 23348 UNION ALL SELECT t3.id FROM catalog_category AS n0 INNER JOIN catalog_category AS t1 ON n0.id = t1.up INNER JOIN catalog_category AS t2 ON t1.id = t2.up INNER JOIN catalog_category AS t3 ON t2.id = t3.up WHERE n0.id = 23348 )order by rand() limit 15
You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'and catalog.cat in (SELECT t0.id FROM catalog_category' at line 5