Re: Search engine using Mysql and PHP
| From: | burk at pobox dot com | Date: | Mon, 02 Oct 2000 19:29:30 +0000 |
| Subject: | Re: Search engine using Mysql and PHP | ||
| References: | 1 | Groups: | php.db |
| Request: | Send a blank email to php-db+get-3229@lists.php.net to get a copy of this message | ||
I would consider changing the design of your web page. Use
<input type=checkbox>'s to allow the user to select which skill he has.
Do the same thing with the employer pages. Then you have control of the
contents of the fields, and it would make searching and handling the
skill values easier.
Also, I'd use arrays. So my skill array might be $myskills = array(
"perl", "php", "html", "visual-basic", "delphi",
"linux"). Now if you'll
notice, you know how many skills I have: count($myskills); you can find
out if I have visual basic:
if (in_array("visual-basic", $myskills)) call_recruiter();
These two tricks can be put together well enough. If the name of each
<input type=checkbox> is myskills[], then the target of the form
submission will have the array variable $myskills.
Anyway, that's how I'd do it. Hope this helps
-burk
On Mon, 2 Oct 2000, [iso-8859-1] Vikesh wrote:
> Hi FOlks,
>
> I'm developing a website for an IT recruitment agency
> and would like some info on the following.
>
> I have a html textfield that accepts input from the
> user regarding their skills set.
>
> This can be just one word (eg. HTML) or several (eg.
> JAVA C++ PHP ASP).
>
> I'm wanting to use these words to search a MySQL
> database which has a field called "Description" which
> holds information on a vacancy including the skills
> required.
>
> The way i thought to do this was to 'explode' the
> returned string from the form, and assign them to
> variables and use a query such as:
>
> SELECT * FROM tablename WHERE description LIKE
> '%$desc1%' AND description LIKE '%$desc2%' AND
> description LIKE '%$desc3%' ..... and so on......
>
> However i do not know the number of skills that the
> user may enter and also what if the user enters a
> string like 'visual basic' where it should be read as
> one variable but may get split into two cause of the
> space inbetween.
>
> also i need the search to return results firstly using
> 'desc1' AND 'desc2' AND 'desc3' syntax, then once that
> is exhusted, i need it to return results where only
> one or two of the words are mentioned.
>
> There are several points here that i have mentioned
> and I hope some one is able to follow what i have
> said, and also possibly provide a suitable solution.
>
> Many thanks,
>
> Vikesh.
>
>
>
>
>
> __________________________________________________
> Do You Yahoo!?
> Yahoo! Photos - 35mm Quality Prints, Now Get 15 Free!
> http://photos.yahoo.com/
>
>
--
burk@pobox.com
Linux File Managers: http://www.pobox.com/~burk/linuxfile.html