CodeCharge Studio
search Register Login  

Visual PHP Web Development

Visually Create Internationalized Web Applications, Web Reports, Calendars, and more.
CodeCharge.com

YesSoftware Forums -> Archive -> GotoCode Archive

 Search more word

Print topic Send  topic

Author Message
max_nt
Posted: 11/04/2002, 3:58 PM

I want to implement a search for more words with the replacement of the space in the string with the percentual. The search must be executed for all the words in the keyword search and in any position. I'm looking for help to write this code in PHP. Thanks
Nicole
Posted: 11/10/2002, 11:45 PM

Max,
In fact you should:
- catch the parameter string before Where clause is built (the event depends on application used);
- split it into separate words using e.g. PHP split() function and get the array of words;
- build Where in a loop adding the array items to Where clause using OR condition.
Here is sample code for CCS (it comes in grid form before Build Select event). In case you’re using CC put the code in the form Open event and use CC syntax to access field value, change Where and get the parameter.
global $form)name;
if (CCGetParam("paramname", ""))
{
$params = split(" ", CCGetParam("param_name", ""));
$form_name->ds->Where = "";
for ($i = 0; $i<=sizeof($params); $i++)
{
if (form_name->ds->Where == "")
$form_name->ds->Where = " task_name like '%".array_shift($params)."%'" ;
else
$form_name->ds->Where .=" OR task_name like '%".array_shift($params)."%'" ;
}
}

   


These are Community Forums for users to exchange information.
If you would like to obtain technical product help please visit http://support.yessoftware.com.

MS Access to Web

Convert MS Access to Web.
Join thousands of Web developers who build Web applications with minimal coding.

CodeCharge.com

Home   |    Search   |    Members   |    Register   |    Login


Powered by UltraApps Forum created with CodeCharge Studio
Copyright © 2003-2004 by UltraApps.com  and YesSoftware, Inc.