Syntax for select statement

From: Date: Fri, 27 Apr 2001 15:56:08 +0000
Subject: Syntax for select statement
Groups: php.general 
Request: Send a blank email to php-general+get-50649@lists.php.net to get a copy of this message
Hi, I've written PHP routines to work on MySQL and so far so good. However, I have one question. I have a select routine that has the following syntax (which works fine thus far): $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? Thanks, Don

« previous php.general (#50649) next »