You are here: Code for searching a mysql database on multiple terms inputed from an html form « All PHP « IT news, forums, messages
Code for searching a mysql database on multiple terms inputed from an html form

Posted by kenoli on 08/31/06 18:27

I am designing a database with several "key word" columns. Users
wanting to search the database will enter terms into html form fields
from drop down menus populated from existing lookup tables or by adding
their own terms which may, in some cases, be inserted into the lookup
tables for subsequent users. Some of the form fields may be left
empty.

I want to create a query that will include all terms entered into a
field in the form, search the "key word" columns for those terms and
return the IDs of records that have those key words in their "key word"
columns.

I haven't started doing this, though I can see it will raise issues
like vlidating data, what to do with empty form fields, and turning the
form data into a proper SQL query. I can see using the SQL function
IN() and a bunch of ORs.

Does anyone know where I can find some procedural code (preferable) or
an object class to help me do this?

Thanks.

--Kenoli

Kenoli Oleari
Neighborhood Assemblies Network
kenoli@sfnan.org
510-601-8217
http://www.sfnan.org
http://www.horizonsofchange.com

 

Navigation:

[Reply to this message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация