Re: Is there anything in here that could be considered a parse error?

From: Date: Fri, 31 Aug 2001 07:40:44 +0000
Subject: Re: Is there anything in here that could be considered a parse error?
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-65423@lists.php.net to get a copy of this message
<Original message> From: John Meyer <john_meyer@geocities.com> Date: Thu, Aug 30, 2001 at 03:49:57PM -0700 Message-ID: <5.1.0.14.0.20010830154900.00a00d80@pop.mail.yahoo.com> Subject: [PHP] Is there anything in here that could be considered a parse error? > 1 if (empty($DidSurvey[$p_surveyid])) { > 2 if (is_array($p_answers)){ > 3 foreach($p_answers as $value) { > 4 $sql = "INSERT INTO RESULTS(SURVEY_ID, ANSWER_ID) VALUES(" . $p_surveyid . > "," . $value . ");"; > 5 mysql_query($sql); > 6 } > 7 else { </Original message> <Reply> Take a look yourself... Pretty obvious isn't it?! There's some code missing! At least... well... It's not right. You either don't close your foreach() loop which starts at line 3, or you don't close the if() loop which starts at line 2, and you definitely don't close the if() loop which starts at line 1. You probably mean something like: 1 if (empty($DidSurvey[$p_surveyid])) { 2 if (is_array($p_answers)){ 3 foreach($p_answers as $value) { 4 $sql = "INSERT INTO RESULTS(SURVEY_ID, ANSWER_ID) VALUES(" . $p_surveyid . "," . $value . ");"; 5 mysql_query($sql); 6 } 7 } 8 } else { etc. </Reply> -- * R&zE: -- »»»»»»»»»»»»»»»»»»»»»»»» -- Renze Munnik -- DataLink BV -- -- E: renze@datalink.nl -- W: +31 23 5326162 -- F: +31 23 5322144 -- M: +31 6 21811143 -- -- Stationsplein 82 -- 2011 LM HAARLEM -- Netherlands -- -- http://www.datalink.nl -- ««««««««««««««««««««««««

« previous php.general (#65423) next »