You are here: RE: [PHP] Search problem « PHP « IT news, forums, messages
RE: [PHP] Search problem

Posted by Jim Moseby on 05/23/05 18:34

> Hi,
>
> I need to build up a search module for a shop. If I make a
> basic search (product title for example) it is ok.
>
> $query = "SELECT product_id FROM products WHERE title LIKE
> '%$title%'";
>
> But i need an advance search for more than one field (title,
> description, price, weight)
> The problem is that i don't know which field is filled in by
> the user (title, description, price or weight)
> I mean, the user can fill in all fields, or only price field,
> or title and weight etc
>
> How can i do the search?
>
> Thanks

$query = "SELECT product_id FROM products WHERE title LIKE
'%$title%' and description LIKE '%$description%' and price like '%$price%'
and weight like '%weight%'";


JM

 

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

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