[Date Prev][Date Next][Thread Prev][Thread Next][Minivend by date
][Minivend by thread
]
Re: [mv] Searching multiple columns in MySQL problem
At 01:18 PM 10/20/1999 -0700, you wrote:
>****** message to minivend-users from Daniel Ceregatti
><daniel@digitalsavant.com> ******
>
>Ok, this isn't working for me either. What I want to do is create 1 (one)
>text box that will search 3 different columns in the MySQL table. The
>example shows how to search 3 columns, but with 3 text boxes. I've tried a
>few variations, but have failed miserably. Can anyone demonstrate this?
>
>Dan Busarow wrote:
>
> > On Tue, 19 Oct 1999, Daniel Ceregatti wrote:
> > > CGI is escaping the %'s, since these appear in the MySQL logs...the
> first set reads: '% word_that_was_searched_for %', whereas the two
> subsequent ones read: '% %'. As far as the <input...> tag, if type= is
> not specified, it defaults to text.
> >
> > You need to tell minivend that there are three search terms. See
> > "Coordinated and joined searching" in the reference manual.
> >
> > Dan
> > --
> > Dan Busarow 949 443 4172
> > Dana Point Communications, Inc. dan@dpcsys.com
> > Dana Point, California 83 09 EF 59 E0 11 89 B4 8D 09 DB FD E1 DD 0C 82
HTML part
<form action=your_cgi_prog.cgi>
<input type=text name=form_field1>
<input type=text name=form_field2>
<input type=text name=form_field3>
<input type=submit value="Go baba">
</form>
PERL script part (CGI)
#!/usr/local/bin/perl
use CGI
$CGI = new CGI;
use DBI;
# the connect statement
# get CGI stuff
#...
#...
$QUERY = "SELECT table1.col1,table2.col2,table3.col3 from TABLENAME WHERE
table1.$form_field1,table2.$form_field2,table3.$form_field3";
# execute query
$dbh = ...
# take result and print it or something.
Hope this helps, I didn't check it but this is the gist of it. if you need
more then this let me know.
-- Metalogica Inc. - Virtual & Dedicated web servers
-- http://metalogica.com