[PHP] searching a MySQL database

2001-05-06 Thread Jamie Saunders
Hi, I've set up a MySQL database and an HTML search form. I'd like to know how to search the database with whatever it entered into the form. It only needs to be a simple search, returning anything that matches the word(s) entered into the input box in the form. Thanks. Jamie Saunders

Re: [PHP] searching a MySQL database

2001-05-06 Thread bill
On Sun, 6 May 2001, Jamie Saunders wrote: Hi, I've set up a MySQL database and an HTML search form. I'd like to know how to search the database with whatever it entered into the form. It only needs to be a simple search, returning anything that matches the word(s) entered into the input

RE: [PHP] searching a MySQL database

2001-05-06 Thread John Vanderbeck
://gamedesign.incagold.com/) - GameDesign, the industry source for game design and development issues -Original Message- From: bill [mailto:[EMAIL PROTECTED]] Sent: Sunday, May 06, 2001 11:10 AM To: [EMAIL PROTECTED] Subject: Re: [PHP] searching a MySQL database On Sun, 6 May 2001

[PHP] Searching a MySQL database?

2001-01-14 Thread James, Yz
Can anyone tell me what I would use to query a MySQL database in a search? If the search field, was for example, a variable like "town", would the results page use something like this? : $sql = " SELECT * FROM table_name WHERE towns = \"$town\" "; I remember seeing someone post

Re: [PHP] Searching a MySQL database?

2001-01-14 Thread Toby Butzon
You've basically got it... the advantage of LIKE is that you can add wildcards to specify what can be different... towns = '$town' ...and... towns LIKE '$town' ...are essentially the same without the % wildcard character. Thus, towns = '$town' ...is much different than... towns LIKE '%$town%'

Re: [PHP] Searching a MySQL database?

2001-01-14 Thread James, Yz
You've basically got it... the advantage of LIKE is that you can add wildcards to specify what can be different... towns = '$town' ...and... towns LIKE '$town' ...are essentially the same without the % wildcard character. Thus, towns = '$town' ...is much different than... towns LIKE

Re: [PHP] Searching a MySQL database?

2001-01-14 Thread Toby Butzon
towns = '$town' ...and... towns LIKE '$town' ...are essentially the same without the % wildcard character. Thus, towns = '$town' ...is much different than... towns LIKE '%$town%' How different are they? I'm not even sure what a wildcard is? A wildcard is a character that

Re: [PHP] Searching a MySQL database?

2001-01-14 Thread James, Yz
Here are some queries of the above table with their results bases='Ft. Worth' returns record 1 bases LIKE '%Worth%' returns record 1 bases LIKE '%Ft.%' returns 1 2 bases LIKE '%' returns all records (in this case, 1 2) See? That makes perfect sense. Thank you! -- PHP General