shehryarshafiq
Programmer
Hi,
I'm having problems with my sql on a search page, if anyone could help i would greatly appreciate it.
I would like to be able to do a fulltext search on all the users registered with my site.
The search page has two text fields for searching.
The first is location, which will match against the following columns (towncity,countystate,employmenthistory)
The second is user, which will match against the following columns (jobrole,mainsubject,employmenthistory,educationhistory,supportingstatement)
Also when a user registers they have the option to hide their details (dropdown, yes or no). If a user has hidden their details i obviously don't want it appearing in the recordset. (column is called showdetails)
On the results page my sql to create the recordset is
SELECT *
FROM tbl_reg_cand
WHERE (MATCH (towncity,countrystate,employmenthistory) AGAINST ('mm_location')) OR (MATCH (jobrole,mainsubject,employmenthistory,educationhistory,supportingstatement) AGAINST ('mm_teacher')) AND (showdetails = 'yes')
variables
mm_location % request.form("location"
mm_teacher % request.form("teacher"
i added my fulltext index after creating the table using
alter table tbl_reg_users add fulltext (towncity,countrystate,employmenthistory);
and
alter table tbl_reg_users add fulltext (jobrole,mainsubject,employmenthistory,supportingstatement);
Hoever when trying to use this search page, i never get any results. Can anyone see what is wrong with my code? Any help would be most appreciated.
thanks
Shehryar
I'm having problems with my sql on a search page, if anyone could help i would greatly appreciate it.
I would like to be able to do a fulltext search on all the users registered with my site.
The search page has two text fields for searching.
The first is location, which will match against the following columns (towncity,countystate,employmenthistory)
The second is user, which will match against the following columns (jobrole,mainsubject,employmenthistory,educationhistory,supportingstatement)
Also when a user registers they have the option to hide their details (dropdown, yes or no). If a user has hidden their details i obviously don't want it appearing in the recordset. (column is called showdetails)
On the results page my sql to create the recordset is
SELECT *
FROM tbl_reg_cand
WHERE (MATCH (towncity,countrystate,employmenthistory) AGAINST ('mm_location')) OR (MATCH (jobrole,mainsubject,employmenthistory,educationhistory,supportingstatement) AGAINST ('mm_teacher')) AND (showdetails = 'yes')
variables
mm_location % request.form("location"
mm_teacher % request.form("teacher"
i added my fulltext index after creating the table using
alter table tbl_reg_users add fulltext (towncity,countrystate,employmenthistory);
and
alter table tbl_reg_users add fulltext (jobrole,mainsubject,employmenthistory,supportingstatement);
Hoever when trying to use this search page, i never get any results. Can anyone see what is wrong with my code? Any help would be most appreciated.
thanks
Shehryar