> -----Original Message-----
> From: John Taylor-Johnston [mailto:[EMAIL PROTECTED]]
> Sent: 04 December 2002 06:28
> 
> http://ccl.flsh.usherb.ca/print/print.html?search=%26quot%3Bre
> ady+maria%26quot%3B
> http://ccl.flsh.usherb.ca/print/index.html?search=%26quot%3Bre
> ady+maria%26quot%3B
> 
> I blame PHP. Can't be MySQL.
> echo $sql displays the EXACT same thing.
> 
> Debugging ... Works jdaxell.ccl = 2 records found:
> $sql = 'SELECT id,AU,ST,BT,AT FROM '.$table.' WHERE MATCH
> (TNum,YR,AU,ST,SD,BT,BC,AT,PL,PR,PG,LG,AUS,KW,GEO,AN,RB,CO)
> AGAINST (\'"ready maria"\' IN BOOLEAN MODE) ORDER BY id asc';
> http://ccl.flsh.usherb.ca/print/display.test.inc.phps
> 
> 
> Doesn't work - Resembles +ready +maria
> $sql = "SELECT id,AU,ST,BT,AT FROM $table WHERE MATCH
> (TNum,YR,AU,ST,SD,BT,BC,AT,PL,PR,PG,LG,AUS,KW,GEO,AN,RB,CO)
> AGAINST ('".stripslashes($search)."' IN BOOLEAN MODE) ORDER 
> BY id asc";
> http://ccl.flsh.usherb.ca/print/display.table.inc.phps
> 
> Doesn't work - Resembles +ready +maria
> $sql = "SELECT id,AU,ST,BT,AT FROM ".$table." WHERE MATCH
> (TNum,YR,AU,ST,SD,BT,BC,AT,PL,PR,PG,LG,AUS,KW,GEO,AN,RB,CO)
> AGAINST ('".stripslashes($search)."' IN BOOLEAN MODE) ORDER 
> BY id asc";
> http://ccl.flsh.usherb.ca/print/display.table.inc.phps
> 
> 
> Doesn't work - Resembles +ready +maria
> $sql = 'SELECT id,AU,ST,BT,AT FROM '.$table.' WHERE MATCH
> (TNum,YR,AU,ST,SD,BT,BC,AT,PL,PR,PG,LG,AUS,KW,GEO,AN,RB,CO)
> AGAINST (\''.stripslashes($search).'\' IN BOOLEAN MODE) ORDER 
> BY id asc';
> http://ccl.flsh.usherb.ca/print/display.table.inc.phps

As far as I can see, *none* of these produce an identical query string to
your hard-coded version -- they *all* have the double-quotes around the
search string missing!

Try this:

  $sql = 'SELECT id,AU,ST,BT,AT FROM '.$table.' WHERE MATCH
  (TNum,YR,AU,ST,SD,BT,BC,AT,PL,PR,PG,LG,AUS,KW,GEO,AN,RB,CO)
  AGAINST (\'"'.stripslashes($search).'"\' IN BOOLEAN MODE)
  ORDER BY id asc';

(BTW, I'm not sure you need the stripslashes() -- I don't use MySQL, so I
can't be sure, but doesn't it need quotes to be backslash-escaped inside a
quoted string?)

Cheers!

Mike

---------------------------------------------------------------------
Mike Ford,  Electronic Information Services Adviser,
Learning Support Services, Learning & Information Services,
JG125, James Graham Building, Leeds Metropolitan University,
Beckett Park, LEEDS,  LS6 3QS,  United Kingdom
Email: [EMAIL PROTECTED]
Tel: +44 113 283 2600 extn 4730      Fax:  +44 113 283 3211 

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to