Ello,
I am trying to implement a search on specific library materials, I have given a web page (request and design by the librarians) where user simply enter a word or phrase in the find input fields (max of four) and they have a selection of searchable fields as Title, keywords, author.
Full Boolean/Logic searches are also needed the AND, OR, and NOT operators.
I have attempt many SQL statements using the post method.
I wanting to know what is the best strategy/ways accomplish this?
Should I query each find with its logic?
I also like to know how would I optimise those queries in the database end.
I have dumped the HTML code of the web page for anyone who does not understand what I am trying to get across.
Any common or suggestions are welcome.
I am using MySQL Server version 3.23.22 and php-3.0.12-6.
annalise
---the html code---
<CENTER>
<FORM METHOD ="post" ACTION ="blar.php3">
<TABLE BORDER ="0">
<TR><TH ALIGN ="CENTER" COLSPAN ="3"><B CLASS=typeC>Search</B></TH></TR>
<TR><TH ALIGN ="LEFT"> </TH><TD><B>Find :</B></TD> <TD><B>Field:</B></TD></TR>
<TR><TD> </TD><TD><INPUT TYPE=TEXT NAME="find1" MAXLENGHT ="40" SIZE ="35"></INPUT> IN </TD>
<TD><SELECT NAME ='fieldpick1'>
<OPTION SELECTED VALUE =http://www.phpbuilder.com/board/archive/index.php/"all"> All Fields</OPTION>
<OPTION VALUE ="keywords"> Keyword(s)</OPTION>
<OPTION VALUE ="Author"> Author</OPTION>
<OPTION VALUE ="Title"> Title</OPTION>
</SELECT>
</TD>
</TR>
<TR><TD><SELECT NAME ='logic1'>
<OPTION SELECTED VALUE =http://www.phpbuilder.com/board/archive/index.php/"AND"> AND</OPTION>
<OPTION VALUE ="OR"> OR</OPTION>
<OPTION VALUE ="<>"> NOT</OPTION>
</SELECT>
</TD>
<TD><INPUT TYPE=TEXT NAME="find2" MAXLENGHT ="40" SIZE ="35"></INPUT> IN </TD>
<TD><SELECT NAME ='fieldpick2'>
<OPTION SELECTED VALUE =http://www.phpbuilder.com/board/archive/index.php/"all"> All Fields</OPTION>
<OPTION VALUE ="keywords"> Keyword(s)</OPTION>
<OPTION VALUE ="Author"> Author</OPTION>
<OPTION VALUE ="Title"> Title</OPTION>
</SELECT>
</TD>
</TR>
<TR><TD><SELECT NAME ='logic2'>
<OPTION SELECTED VALUE =http://www.phpbuilder.com/board/archive/index.php/"AND"> AND</OPTION>
<OPTION VALUE ="OR"> OR</OPTION>
<OPTION VALUE ="<>"> NOT</OPTION>
</SELECT>
</TD>
<TD><INPUT TYPE=TEXT NAME="find3" MAXLENGHT ="40" SIZE ="35"></INPUT> IN </TD>
<TD><SELECT NAME ='fieldpick3'>
<OPTION SELECTED VALUE =http://www.phpbuilder.com/board/archive/index.php/"all"> All Fields</OPTION>
<OPTION VALUE ="keywords"> Keyword(s)</OPTION>
<OPTION VALUE ="Author"> Author</OPTION>
<OPTION VALUE ="Title"> Title</OPTION>
</SELECT>
</TD>
</TR>
<TR><TD><SELECT NAME ='logic3'>
<OPTION SELECTED VALUE =http://www.phpbuilder.com/board/archive/index.php/"AND"> AND</OPTION>
<OPTION VALUE ="OR"> OR</OPTION>
<OPTION VALUE ="<>"> NOT</OPTION>
</SELECT>
</TD>
<TD><INPUT TYPE=TEXT NAME="find4" MAXLENGHT ="40" SIZE ="35"></INPUT> IN </TD>
<TD><SELECT NAME ='fieldpick4'>
<OPTION SELECTED VALUE =http://www.phpbuilder.com/board/archive/index.php/"all"> All Fields</OPTION>
<OPTION VALUE ="keywords"> Keyword(s)</OPTION>
<OPTION VALUE ="Author"> Author</OPTION>
<OPTION VALUE ="Title"> Title</OPTION>
</SELECT>
</TD>
</TR>
<TR></TR>
</TABLE><BR><INPUT TYPE="submit" VALUE="Start Search"></INPUT>
<INPUT TYPE="reset" VALUE="Clear Search Details"></INPUT>
<INPUT TYPE="button" VALUE="Back" onclick="history.back()"></INPUT>
</FORM>
</CENTER>
I am trying to implement a search on specific library materials, I have given a web page (request and design by the librarians) where user simply enter a word or phrase in the find input fields (max of four) and they have a selection of searchable fields as Title, keywords, author.
Full Boolean/Logic searches are also needed the AND, OR, and NOT operators.
I have attempt many SQL statements using the post method.
I wanting to know what is the best strategy/ways accomplish this?
Should I query each find with its logic?
I also like to know how would I optimise those queries in the database end.
I have dumped the HTML code of the web page for anyone who does not understand what I am trying to get across.
Any common or suggestions are welcome.
I am using MySQL Server version 3.23.22 and php-3.0.12-6.
annalise
---the html code---
<CENTER>
<FORM METHOD ="post" ACTION ="blar.php3">
<TABLE BORDER ="0">
<TR><TH ALIGN ="CENTER" COLSPAN ="3"><B CLASS=typeC>Search</B></TH></TR>
<TR><TH ALIGN ="LEFT"> </TH><TD><B>Find :</B></TD> <TD><B>Field:</B></TD></TR>
<TR><TD> </TD><TD><INPUT TYPE=TEXT NAME="find1" MAXLENGHT ="40" SIZE ="35"></INPUT> IN </TD>
<TD><SELECT NAME ='fieldpick1'>
<OPTION SELECTED VALUE =http://www.phpbuilder.com/board/archive/index.php/"all"> All Fields</OPTION>
<OPTION VALUE ="keywords"> Keyword(s)</OPTION>
<OPTION VALUE ="Author"> Author</OPTION>
<OPTION VALUE ="Title"> Title</OPTION>
</SELECT>
</TD>
</TR>
<TR><TD><SELECT NAME ='logic1'>
<OPTION SELECTED VALUE =http://www.phpbuilder.com/board/archive/index.php/"AND"> AND</OPTION>
<OPTION VALUE ="OR"> OR</OPTION>
<OPTION VALUE ="<>"> NOT</OPTION>
</SELECT>
</TD>
<TD><INPUT TYPE=TEXT NAME="find2" MAXLENGHT ="40" SIZE ="35"></INPUT> IN </TD>
<TD><SELECT NAME ='fieldpick2'>
<OPTION SELECTED VALUE =http://www.phpbuilder.com/board/archive/index.php/"all"> All Fields</OPTION>
<OPTION VALUE ="keywords"> Keyword(s)</OPTION>
<OPTION VALUE ="Author"> Author</OPTION>
<OPTION VALUE ="Title"> Title</OPTION>
</SELECT>
</TD>
</TR>
<TR><TD><SELECT NAME ='logic2'>
<OPTION SELECTED VALUE =http://www.phpbuilder.com/board/archive/index.php/"AND"> AND</OPTION>
<OPTION VALUE ="OR"> OR</OPTION>
<OPTION VALUE ="<>"> NOT</OPTION>
</SELECT>
</TD>
<TD><INPUT TYPE=TEXT NAME="find3" MAXLENGHT ="40" SIZE ="35"></INPUT> IN </TD>
<TD><SELECT NAME ='fieldpick3'>
<OPTION SELECTED VALUE =http://www.phpbuilder.com/board/archive/index.php/"all"> All Fields</OPTION>
<OPTION VALUE ="keywords"> Keyword(s)</OPTION>
<OPTION VALUE ="Author"> Author</OPTION>
<OPTION VALUE ="Title"> Title</OPTION>
</SELECT>
</TD>
</TR>
<TR><TD><SELECT NAME ='logic3'>
<OPTION SELECTED VALUE =http://www.phpbuilder.com/board/archive/index.php/"AND"> AND</OPTION>
<OPTION VALUE ="OR"> OR</OPTION>
<OPTION VALUE ="<>"> NOT</OPTION>
</SELECT>
</TD>
<TD><INPUT TYPE=TEXT NAME="find4" MAXLENGHT ="40" SIZE ="35"></INPUT> IN </TD>
<TD><SELECT NAME ='fieldpick4'>
<OPTION SELECTED VALUE =http://www.phpbuilder.com/board/archive/index.php/"all"> All Fields</OPTION>
<OPTION VALUE ="keywords"> Keyword(s)</OPTION>
<OPTION VALUE ="Author"> Author</OPTION>
<OPTION VALUE ="Title"> Title</OPTION>
</SELECT>
</TD>
</TR>
<TR></TR>
</TABLE><BR><INPUT TYPE="submit" VALUE="Start Search"></INPUT>
<INPUT TYPE="reset" VALUE="Clear Search Details"></INPUT>
<INPUT TYPE="button" VALUE="Back" onclick="history.back()"></INPUT>
</FORM>
</CENTER>