Đang Thực Hiện

426909 PHP Query Help for 68 Classifieds Site

PLEASE ONLY BID IF YOU UNDERSTAND WHAT I'M ASKING FOR.

I'm using 68 Classifieds and the script automatically generates a query when a user performs a search on the site. A sample search generates the following query:

SELECT pID FROM class_products_fields WHERE fID=26 AND sValue LIKE '%Bay Ridge|%' AND sValue LIKE '%Bed-Stuy|%'

That query doesn't return any values because I need an OR statement on the THIRD CONDITION. I need my query to read like this:

SELECT pID FROM class_products_fields WHERE fID=26 AND sValue LIKE '%Bay Ridge|%' OR sValue LIKE '%Bed-Stuy|%'

The code that's generating the SQL is this:

$option=str_replace('opt','',$objItem);

$option = (int)$option;

$search='';

foreach($objValue as $key)

{

$search2 = $key.'|';

$search .= "AND sValue LIKE '%". safeAddSlashes($search2) ."%' ";

}

This project is to modify the code so that each pass after the first AND will use an OR statement instead of just writing AND statements.

Kỹ năng: Bất kì công việc gì, PHP, SQL

Xem thêm: n query, c for int, writing bay, php writing, php code sample code, sql statement help, pass query, help modify, php sql script project, sql query help, modify query, sql select script, help writing sql, writing statement, project sql query, key project php, bay classifieds, project query, sql query project, search query, classifieds help, modify php code, classifieds search, generates site, need sql query

Về Bên Thuê:
( 27 nhận xét )

Mã Dự Án: #2172779

Đã trao cho:

codemiracles

Right now!

$10 USD trong 0 ngày
(62 Đánh Giá)
5.2