Now, i have 0 result when i make a search.
$sql = "
SELECT i.pk_i_id, d.s_title, i.i_price, i.fk_c_currency_code, CONCAT(r.s_path, r.pk_i_id,'_thumbnail.',r.s_extension) as image_url
FROM {$db_prefix}t_item i
INNER JOIN {$db_prefix}t_item_description d
ON d.fk_i_item_id = i.pk_i_id
LEFT OUTER JOIN {$db_prefix}t_item_resource r
ON r.fk_i_item_id = i.pk_i_id AND r.pk_i_id = (
SELECT rs.pk_i_id
FROM {$db_prefix}t_item_resource rs
WHERE i.pk_i_id = rs.fk_i_item_id
LIMIT 1
)
WHERE d.fk_c_locale_code = '" . osc_current_user_locale() . "' AND (s_title LIKE '%" . $pattern . "%' OR s_description LIKE '%" . $pattern . "%') AND b_active = 1 AND b_enabled = 1 AND b_spam = 0
ORDER BY dt_pub_date DESC
AND i.fk_i_category_id NOT IN (327, 326, 325, 324, 323, 322, 321, 320, 1335, 1334, 1333, 1332, 1331, 1330, 1329, 1328, 1327, 319, 318, 317, 316, 1326, 1325, 315, 314, 1324, 1323, 313, 312, 311, 1322, 1321, 1320, 1319, 310, 209, 308, 1318, 1317, 307, 107)
LIMIT " . $max . ";
";