www.mithril.ca

Web-Based Apps :: MySQL Useage Examples

Web-Based Apps
phpClassifieds Demo
MP3 Database Search
MP3 Search Engine
Search Engine
Mithril Web Mail
Code Samples
PHP
PHP-GTK
Visual Basic
more info.....
Links of Interest
php.net
gtk.php-net
OSDN.org
SourceForge.net
Corrado Club of Canada
The Onion
more links...
Personal Info.
About Geoff A. Virgo
Site Statistics
Contact the Sys. Admin
Here's a quick and dirty intro to using MySQL's wildcards.  The two wildcards available for use in SQL queries are the underscore ( _ ) and the percent symbol (%).  The underscore is a single value variable will the percent symbol is a multi-value variable.  The percent symbol and the asterisk are interchangeable.

N.B.    The contents of the search string are not case sensitive.  This means that the database will interpret any combination of upper and lower case characters in the same way and produce the same results to the query.
           

Usage:

_{search string}
 

This will give you entries which match the search sting and begin with any character.

     Ex.  _imp Bizkit will return "Limp Bizkit".
%{search string}
 
This will return all entries which end with the specified search sting, regardless of the number of characters preceeding the search string.

     Ex.  %er will return all entries ending in "er" such as "Adam Sandler" and "Filter".


_{search string}%
 

This will return all values with any first character and any series of characters after the search string which contain the string string.

      Ex.  _et% will return both "Metallica" and "Pet<er Frampton"

N.B.    If the underscore is used for any character position except the first in a search, it must be prefixed by the percent symbol.

Page generation: 0.015086 sec