Re: Whimper, help :)

From: Date: Wed, 04 Dec 2002 08:10:23 +0000
Subject: Re: Whimper, help :)
References: 1 2  Groups: php.general 
Request: Send a blank email to php-general+get-126957@lists.php.net to get a copy of this message
why '.$table.' and not '".$table."' with what you've got now, I believe you are looking for .table name. instead of table name and if your table name is only one word, a good practice I'm told, ditch the ' and " marks entirely and just use ...FROM $table WHERE... also, use double quotes for start and end of variables as in: $sql="select * from '".$table."' where var='some value other than a number' "; Hope this helps Hugh "We have met the enemy and they is us!" Pogo ----- Original Message ----- From: "John Taylor-Johnston" <taylorjo@collegesherbrooke.qc.ca> To: <php-general@lists.php.net> Sent: Tuesday, December 03, 2002 10:28 PM Subject: Re: [PHP] Whimper, help :) > http://ccl.flsh.usherb.ca/print/print.html?search=%26quot%3Bready+maria%26qu ot%3B > http://ccl.flsh.usherb.ca/print/index.html?search=%26quot%3Bready+maria%26qu ot%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 > > > :0 > John > > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php >

« previous php.general (#126957) next »