SET @value = '';
SELECT
id, order_kind, property_kind, town, images, agreement, uprice, eprice,
tprice, pprice, bprice, qprice, status, createtime, town_title, fullname,
mobile, profile_image, area, barea, address,
CONCAT(id+9000) AS sid,
CONCAT(area,' m') AS marea,
CONCAT(barea,' m') AS mbarea
FROM `sells`
WHERE `order_kind` = '$order_kind'
AND `property_kind` = '$property_kind'
AND (
sid LIKE CONCAT('%', @value, '%') ||
town_title LIKE CONCAT('%', @value, '%') ||
fullname LIKE CONCAT('%', @value, '%') ||
mobile LIKE CONCAT('%', @value, '%') ||
marea LIKE CONCAT('%', @value, '%') ||
mbarea LIKE CONCAT('%', @value, '%') ||
address LIKE CONCAT('%', @value, '%')
)
I use this sql for searching, and erroring unknown column 'sid' in where clause
i change where to having but not work php loop