Re: Syntax for select statement

From: Date: Fri, 27 Apr 2001 18:44:14 +0000
Subject: Re: Syntax for select statement
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-50679@lists.php.net to get a copy of this message
also note that if magic_quotes_gpc setting (in php.ini) is on, these quotes will automagically be escaped. phpinfo() will tell you your setting, as will get_magic_quotes_gpc(). http://www.php.net/manual/en/configuration.php#ini.magic-quotes-gpc run around the manual for more information. regards, philip On Fri, 27 Apr 2001, Christian Reiniger wrote: > On Friday 27 April 2001 17:56, Don Pro wrote: > > > $queryID = mysql_query("SELECT Country, Agent FROM Ports > > WHERE Portname = '$portname'"); > > > > My question is, if the variable $portname has the ' character within > > in, will this cause an error in my select statement? If the answer is > > "Yes", can someone give me a more robust way of writing it using PHP? > > Yes. > use addslashes() > > -- > Christian Reiniger > LGDC Webmaster (http://sunsite.dk/lgdc/) > > Error 032: Recursion error - see error 032 > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, e-mail: php-general-unsubscribe@lists.php.net > For additional commands, e-mail: php-general-help@lists.php.net > To contact the list administrators, e-mail: php-list-admin@lists.php.net >

« previous php.general (#50679) next »