|
Новичок
Регистрация: 03.08.2009
Сообщений: 7
С нами:
8827380
Репутация:
0
|
|
помогите с инекцией как сделать правильный запрос
SELECT SQL_CALC_FOUND_ROWS DISTINCT i.id, i.dimensions, i.prweight, i.prtype, i.processor, i.slots2 as slots, i.cards2 as cards, i.os2 as os, i.memory2 as memory, i.description2 as description, i.display2 as display, i.resolution2 as resolution, i.battery2 as battery, i.communication2 as communication, i.other2 as other, i.control2 as control, i.handcr2 as handcr, i.adddevice2 as adddevice, i.contents2 as contents, i.apps2 as apps, i.price, i.pricepromo, i.text2 as text, date_format(i.addtime,'%d/%m/%Y') as litaddtime, if(i.instock = 1,'instock','notinstock') as state, if(i.title2 <>'', i.title2,i.title2) as title, if(c.title2 <>'',c.title2,c.title2) as category, br.title as brand, br.onhp as otherbr, ifnull(im1.image,im.image) as image, im.firstimage, if(i.category_id in(1,3),1,0) as pdas, i.brand_id, i.category_id, i.status FROM items as i left join brands as br on i.brand_id = br.id left join categories as c on i.category_id = c.id left join images as im on im.item_id = i.id left join images as im1 on im1.item_id = i.id and im1.firstimage = 1 WHERE i.active=1 AND i.status ='Active' GROUP BY i.id HAVING 1=1 AND ( id='a'' OR title like '%a'%' or description like '%a'%' or communication like '%a'%' or other like '%a'%' or contents like '%a'%' or apps like 'a'' or memory like '%a'%' or display like '%a'%' or category like '%a'%' or brand like '%a'%' or processor like '%a'%' or text like 'a'' ) LIMIT 0, 4
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 ''%' or description like '%a'%' or communication like '%a'%' or other like '%a'' at line 54
параметр передается везде где сейчас a'
|