Search firstname column problem 10 Years, 3 Months ago
|
Karma: 0
|
My issue is that I've got a query working but it isn't getting forms of the word. If I want to search by firstname and I put Sa and submit I don't get any results, if I put Sam in I get all the Sam results. How do I change this query so I get forms of the word? So if I type Sa I get the Sam results, the Samantha results, etc.
I've tried a few Like statements, but just can't get anything to work.
Here is my query tha word for the full name:
SELECT firstname AS FirstName, lastname AS LastName, cb_phone AS Phone, cb_address AS Address, cb_address2 AS Address2, cb_city AS City,cb_state AS State, cb_zip AS Zip
FROM joom_comprofiler
WHERE
({$REQUEST:start|empty:''} = '' OR firstname ={$REQUEST:start|empty:''})
AND
({$REQUEST:end|empty:''} = '' OR lastname = {$REQUEST:end|empty:''})
ORDER by firstname ASC
Thank you for any help!
I love Ari Data Tables! Thank you so much!!!
TK
|
|
|
|
|
Re:Search firstname column problem 10 Years, 3 Months ago
|
Karma: 760
|
Hello,
Where we can see the problem?
Regards,
ARI Soft
|
|
|
|
|
Re:Search firstname column problem 10 Years, 3 Months ago
|
Karma: 0
|
Send login info in private email. Let me know if you need more information.
|
|
|
|
|
Re:Search firstname column problem 10 Years, 3 Months ago
|
Karma: 760
|
Use LIKE operator instead of = in WHERE clause.
Regards,
ARI Soft
|
|
|
|
|
Re:Search firstname column problem 10 Years, 3 Months ago
|
Karma: 0
|
I tried LIKE, but I don't get any search results. I've been testing AM since I know there is an AMY in the database.
Trying to search Like with submit field for first and/or last name.This is the query I have, but same results as when I use the = .
SELECT firstname AS FirstName, lastname AS LastName, cb_phone AS Phone, cb_address AS Address, cb_address2 AS Address2, cb_city AS City,cb_state AS State, cb_zip AS Zip
FROM joom_comprofiler
WHERE ({$REQUEST:start|empty:''} LIKE '' OR firstname LIKE{$REQUEST:start|empty:''})
AND
({$REQUEST:end|empty:''} LIKE '' OR lastname LIKE {$REQUEST:end|empty:''})
ORDER by firstname ASC
|
|
|
|
|
Re:Search firstname column problem 10 Years, 3 Months ago
|
Karma: 760
|
It is incorrect. The previous post contains the link to the page with description of LIKE operator.
Regards,
ARI Soft
|
|
|
|
|
|