We hope you enjoy your visit.

You're currently viewing our forum as a guest. This means you are limited to certain areas of the board and there are some features you can't use. If you join our community, you'll be able to access member-only sections, and use many member-only features such as customizing your profile, sending personal messages, and voting in polls. Registration is simple, fast, and completely free.


Join our community!


If you're already a member please log in to your account to access all of our features:

Username:   Password:
Add Reply
PHP Loose Matching
Topic Started: Sep 26 2008, 04:03 PM (531 Views)
Viral.
Member Avatar
Member
[ *  *  *  *  *  * ]
How can I use loose matching in a mysql query? I have tried:
Code: HTML
 
SELECT * FROM series WHERE name LIKE '$s_name'

but that only allowed for perfect, non case sensitive matching.
Offline Profile Quote Post Goto Top
 
mcteeth
Member Avatar
Oh, Comely.
[ *  * ]
Use wildcards:
Code:
 
x LIKE '%test%'

This matches "test" and any string with "test" in it. %test and test% do the same with the exception that "test" is either at the end or the beginning of the string.
Edited by mcteeth, Sep 26 2008, 07:36 PM.
Offline Profile Quote Post Goto Top
 
Viral.
Member Avatar
Member
[ *  *  *  *  *  * ]
Thanks mcteeth :) .
Offline Profile Quote Post Goto Top
 
1 user reading this topic (1 Guest and 0 Anonymous)
« Previous Topic · Technology Chat · Next Topic »
Add Reply