I found some stuff in the mySql manual about setting columns as fulltext
indexes for fulltext searches and the syntax is
WHERE MATCH (column names...) AGAINST (the search stuff)
So I went in and did an alter table statement to set my four search columns
to be in a fulltext index.
So here's the freaky thing ... I create this hideous looking select
statement to grab the right stuff out of the database (all the stuff ending
in _int and $searchwords are the variables from the search form that the
user fills out to pick the designs they want to see)
>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
$query = "SELECT * FROM designs, appliquetable, puffyfoamtable
WHERE designs.puffyfoam = puffyfoamtable.puffyfoam
AND designs.applique = appliquetable.applique
AND designs.applique=$applique_int
AND designs.puffyfoam=$pfoam_int
AND designs.largesize <= $largesize_int
AND designs.smallsize <= $smallsize_int
AND designs.availablefiles LIKE "%$file_int%"
AND MATCH(designname,designcomments,catcode,textsearch)
AGAINST ($searchwords)";
$result = mysql_query($query)
or die ("Couldn't execute query A<2 P<2.");
>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
And I get the "Couldn't execute query A<2 P<2." Error... but when I copy the
statement into phpMyAdmin SQL screen and put values in the spots like below,
it actually finds the one record in the database that matches:
>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
SELECT * FROM designs, appliquetable, puffyfoamtable
WHERE designs.puffyfoam = puffyfoamtable.puffyfoam
AND designs.applique = appliquetable.applique
AND designs.applique = 0
AND designs.puffyfoam = 0
AND designs.largesize <= 4.00
AND designs.smallsize <= 4.00
AND designs.availablefiles LIKE "%SEW%"
AND MATCH ( designname, designcomments, catcode, textsearch) AGAINST
('sports')
>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
It probably something stupid like quotes or something ... I'm gonna go back
and double-check those variables from the search form ... Anybody out there
see what I missed? :)
RENEE :)
Renee Toth
Stitchin' Up A Storm
www.stitchinupastorm.com
---------------------------------------------------------------------
Before posting, please check:
http://www.mysql.com/manual.php (the manual)
http://lists.mysql.com/ (the list archive)
To request this thread, e-mail <[EMAIL PROTECTED]>
To unsubscribe, e-mail <[EMAIL PROTECTED]>
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php