W dniu 22 marca 2012 20:30 użytkownik Tomasz Chiliński
<tomasz.chilinski@chilan.com> napisał:
Co pokazuje Ci:
SELECT * FROM `location_streets` WHERE `name` LIKE %XX-lecia% AND `cityid` = 675;
bez ciapków "'" dla LIKE jest błąd składni
mysql> SELECT * FROM location_streets WHERE name LIKE %XX-lecia% AND cityid = 675;
ERROR 1064 (42000): 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 '%XX-lecia% AND cityid = 675' at line 1
z ciapkami jest ok, czy to są podwójne czy pojedyńcze jest ok
mysql> SELECT * FROM location_streets WHERE name LIKE "%XX-lecia%" AND cityid = 675;
+------+----------+-------+-------+--------+--------+
| id | name | name2 | ident | typeid | cityid |
+------+----------+-------+-------+--------+--------+
| 3935 | XX-lecia | NULL | 25178 | 6 | 675 |
+------+----------+-------+-------+--------+-----