Examples of Generated Queries
PHP MySQL Search Script is our product that generates advanced MySQL Search Queries for the LIKE database syntax for integration into your existing
application.
From a search box where users will be entering their search terms such as:
"From Paris with Love" + Movie + Travolta -IMDB | Romance
Will Produce:
(((desc LIKE "%From Paris with Love%" AND desc LIKE "%Movie%" AND desc LIKE "%Travolta%") OR (desc LIKE "%Romance%")) AND (desc NOT LIKE "%IMDB%"))
"Ice-Cream" -Chocolates -Sweets | Strawberries "Jam Tarts"
Will Produce:
(((desc LIKE "%Ice-Cream%" AND desc LIKE "%Jam Tarts%") OR (desc LIKE "%Strawberries%")) AND (desc NOT LIKE "%Chocolates%" AND desc NOT LIKE "%Sweets%"))
PHP MySQL Search Script supports matching various boolean queries into a single query with ONE Line Of PHP Code.
The generated queries follow the MySQL LIKE syntax. In the above example, results containing the phrases "Ice-Cream" and "Jam Tarts" that do not also contain the words Chocolates or Sweets will be
shown. Also, any records that contain the word Strawberries without Chocolates and Sweets in the same document will be shown. In summary, the user is looking for documents containing
ice-creams and jam starts or simply strawberries, but either criteria must not have chocolates and sweets within the same database field.
Features
- Supports MYSQL Like Syntax with automatic escaping of special characters
- AND search using plus sign ('+') character
- OR search using pipe vertical bar ('|') character
- Phrase search by enclosing search terms in double quotes ("sweet chocolates")
- NOT search using minus sign ('-') character
- Any search characters within double quotes ('+','-','|') are treated as literal characters
- Simply pass the database search column name as a parameter to the query generator function to automatically insert it into the query
- One Line of PHP Code to generate the MySQL search query:
<? print parse_keywords("recipe", '"Ice-Cream" -Chocolates -Sweets | Strawberries "Jam Tarts"'); ?>
- Easily complete the php query by appending the generated query to your select clause:
$query = "select * from table_name where " . $generated_query;
- Automatic error correction for search terms. Will automatically correct wrongly entered syntax for search terms such as:
+ bread --cake |pudding to
+bread -cake | pudding Errors involving multiple spaces and multiple search characters are automatically fixed.
- Search results highlighting can be turned on or off
ACTUAL LIVE DEMO
Table: Secret Recipes
| Record ID |
Author |
Description |
Date Added |
| 1 |
Jacob Daniels |
* 2 pounds ground beef
* 1 egg, beaten
* 3/4 cup dry bread crumbs
* 3 tablespoons evaporated milk
* 2 tablespoons Worcestershire sauce
* 1/8 teaspoon cayenne pepper
* 2 cloves garlic, minced
|
2011-09-18 |
| 2 |
Linda Kelly |
* 1 1/2 pounds lean ground beef
* 1/2 onion, chopped
* 4 cups frozen mixed vegetables
* 1 (19 ounce) can cream of chicken soup
* 1 (32 ounce) package frozen potato rounds
|
2011-09-18 |
| 3 |
Leonard Mareuses |
* Grated carrots or potatoes
* Diced onions, celery, or bell peppers
* Chopped tomatoes or spinach
* Asparagus spears
* Minced garlic
* Canned, roasted, or fresh chiles
* Corn kernels
* Dry soup mixes or dry salad dressing mixes. |
2011-09-18 |
| 4 |
Deen Kerry |
* 2 pounds ground turkey
* 1 cup milk
* 1 cup Italian seasoned bread crumbs
* 2 eggs
* 1 teaspoon salt
* 1/4 teaspoon pepper
* 3/4 pound Colby cheese, cut into 1/2-inch cubes
* 1/2 cup ketchup (optional)
|
2011-09-17 |
| 5 |
Sheila |
* 2 navel oranges, thinly sliced
* 2 lemons, thinly sliced
* 2 limes, thinly sliced
* 1 pear, cored and chopped
* 1 kiwi, peeled and sliced
* 1 cup fresh strawberries, sliced
* 1 (20 ounce) can pineapple chunks in juice
* 1/2 cup white sugar
* 1/2 cup Cointreau or other orange liqueur
* 1 cup white rum
* 1/3 cup coconut-flavored rum
* 2 cups orange juice
* 2 (750 milliliter) bottles dry red wine, chilled
* 1/2 (12 fluid ounce) can frozen pink lemonade concentrate, thawed
* 1/4 cup lemon juice
* 2 tablespoons lime juice
* 1 cup lemon-lime soda, chilled
|
2011-09-15 |
| 6 |
Lisa |
* 1 lemon
* 1 lime
* 1 orange
* 1 1/2 cups rum
* 1/2 cup white sugar
* 1 (750 milliliter) bottle dry red wine
* 1 cup orange juice
|
2011-09-14 |
| 7 |
Tammy |
* 4 eggs
* 1 1/4 cups vegetable oil
* 2 cups white sugar
* 2 teaspoons vanilla extract
* 2 cups all-purpose flour
* 2 teaspoons baking soda
* 2 teaspoons baking powder
* 1/2 teaspoon salt
* 2 teaspoons ground cinnamon
* 3 cups grated carrots
* 1 cup chopped pecans
*
* 1/2 cup butter, softened
* 8 ounces cream cheese, softened
* 4 cups confectioners' sugar
* 1 teaspoon vanilla extract
* 1 cup chopped pecans
|
2011-09-09 |
| 8 |
Tracy |
* 3 cups grated carrots
* 2 cups all-purpose flour
* 2 cups white sugar
* 2 teaspoons baking soda
* 1 teaspoon baking powder
* 1/2 teaspoon salt
* 1 teaspoon ground cinnamon
* 4 eggs
* 1 1/2 cups vegetable oil
* 1 1/4 teaspoons vanilla extract
* 1 (8 ounce) can crushed pineapple with juice
* 3/4 cup chopped pecans
*
* 3 1/2 cups confectioners' sugar
* 1 (8 ounce) package Neufchatel cheese
* 1/2 cup butter, softened
* 1 1/4 teaspoons vanilla extract
* 1 cup chopped pecans
|
2011-09-14 |
|
Search Results
| Record ID |
Author |
Description |
Date Added |
| 1 |
Jacob Daniels |
* 2 pounds ground beef
* 1 egg, beaten
* 3/4 cup dry bread crumbs
* 3 tablespoons evaporated milk
* 2 tablespoons Worcestershire sauce
* 1/8 teaspoon cayenne pepper
* 2 cloves garlic, minced
|
2011-09-18 |
| 2 |
Linda Kelly |
* 1 1/2 pounds lean ground beef
* 1/2 onion, chopped
* 4 cups frozen mixed vegetables
* 1 (19 ounce) can cream of chicken soup
* 1 (32 ounce) package frozen potato rounds
|
2011-09-18 |
| 3 |
Leonard Mareuses |
* Grated carrots or potatoes
* Diced onions, celery, or bell peppers
* Chopped tomatoes or spinach
* Asparagus spears
* Minced garlic
* Canned, roasted, or fresh chiles
* Corn kernels
* Dry soup mixes or dry salad dressing mixes. |
2011-09-18 |
| 4 |
Deen Kerry |
* 2 pounds ground turkey
* 1 cup milk
* 1 cup Italian seasoned bread crumbs
* 2 eggs
* 1 teaspoon salt
* 1/4 teaspoon pepper
* 3/4 pound Colby cheese, cut into 1/2-inch cubes
* 1/2 cup ketchup (optional)
|
2011-09-17 |
| 5 |
Sheila |
* 2 navel oranges, thinly sliced
* 2 lemons, thinly sliced
* 2 limes, thinly sliced
* 1 pear, cored and chopped
* 1 kiwi, peeled and sliced
* 1 cup fresh strawberries, sliced
* 1 (20 ounce) can pineapple chunks in juice
* 1/2 cup white sugar
* 1/2 cup Cointreau or other orange liqueur
* 1 cup white rum
* 1/3 cup coconut-flavored rum
* 2 cups orange juice
* 2 (750 milliliter) bottles dry red wine, chilled
* 1/2 (12 fluid ounce) can frozen pink lemonade concentrate, thawed
* 1/4 cup lemon juice
* 2 tablespoons lime juice
* 1 cup lemon-lime soda, chilled
|
2011-09-15 |
| 6 |
Lisa |
* 1 lemon
* 1 lime
* 1 orange
* 1 1/2 cups rum
* 1/2 cup white sugar
* 1 (750 milliliter) bottle dry red wine
* 1 cup orange juice
|
2011-09-14 |
| 7 |
Tammy |
* 4 eggs
* 1 1/4 cups vegetable oil
* 2 cups white sugar
* 2 teaspoons vanilla extract
* 2 cups all-purpose flour
* 2 teaspoons baking soda
* 2 teaspoons baking powder
* 1/2 teaspoon salt
* 2 teaspoons ground cinnamon
* 3 cups grated carrots
* 1 cup chopped pecans
*
* 1/2 cup butter, softened
* 8 ounces cream cheese, softened
* 4 cups confectioners' sugar
* 1 teaspoon vanilla extract
* 1 cup chopped pecans
|
2011-09-09 |
| 8 |
Tracy |
* 3 cups grated carrots
* 2 cups all-purpose flour
* 2 cups white sugar
* 2 teaspoons baking soda
* 1 teaspoon baking powder
* 1/2 teaspoon salt
* 1 teaspoon ground cinnamon
* 4 eggs
* 1 1/2 cups vegetable oil
* 1 1/4 teaspoons vanilla extract
* 1 (8 ounce) can crushed pineapple with juice
* 3/4 cup chopped pecans
*
* 3 1/2 cups confectioners' sugar
* 1 (8 ounce) package Neufchatel cheese
* 1/2 cup butter, softened
* 1 1/4 teaspoons vanilla extract
* 1 cup chopped pecans
|
2011-09-14 |
|
|
PHP 4 or greater
MySQL 4 or greater
Windows, Unix, Linux or Mac
Price: $45.00 USD
Source Code is NOT encrypted and you can deploy it easily into any system
We provide programming and integration services for $120.00, but this is optional
Please Contact Us if you have any enquiries before buying.
To view usage instructions, click here
|
|
|
|