Turn a user entered query string into a mySQL query...


Without getting too fancy, I want to be able to take a query string like you might enter into a search engine and convert it to a mysql query string.

For example, if we're querying the field 'contents' :

cars cows fish -- returns rows where contents has either %cars%, %cows% or %fish% in it

"cars" cows fish -- rows that have cars, %cows% or %fish%

+cars cows fish -- rows that have %cars% AND cows or fish

+cars -cows fish -- must have %cars%, mustn't have %cows%, may have %fish%

"cars cows fish" -- rows that have the phrase 'cars cows fish'

... or any combinations.

I want a function thus:



// etc

return $formatted_query


To the function we'll pass the $query_string and the field we're querying on - e.g.

$str=modSM_query_convert('+cars +cows','contents');

.. the function will return something like:

(contents like '%cars%' AND contents like '%cows%')

.. for us to then use in our calling function.

As a small extra, remove any nasty looking characters from the string before processing it (e.g. *'s, ?'s etc)

That's all!


## Deliverables

1) Complete and fully-functional working program(s) in executable form as well as complete source code of all work done.

2) Installation package that will install the software (in ready-to-run condition) on the platform(s) specified in this bid request.

3) Exclusive and complete copyrights to all work purchased. (No GPL, 3rd party components, etc. unless all copyright ramifications are explained AND AGREED TO by the buyer on the site).

## Platform

Linux / PHP / Apache / MySQL

Habilidades: Vale Tudo

Ver mais: want buyer, to string, string the, string i, string 2, n query, search string, where fish, str, mysql query, cows, mysql characters, php remove query string, working string, string search, extra field search, php string remove, mysql query php, string processing, site query form, search field extra, php remove string, ready php query form, processing linux code, turn characters

Acerca do Empregador:
( 65 comentários ) United Kingdom

ID do Projeto: #2990210

4 freelancers estão ofertando em média $33 para este trabalho


See private message.

$29.75 USD in 14 dias
(12 Comentários)

See private message.

$25.5 USD in 14 dias
(0 Comentários)

See private message.

$51 USD in 14 dias
(0 Comentários)

See private message.

$25.5 USD in 14 dias
(0 Comentários)