Re: Parse error?
| From: | Boyan Nedkov | Date: | Sat, 15 Nov 2003 21:56:31 +0000 |
| Subject: | Re: Parse error? | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-169775@lists.php.net to get a copy of this message | ||
Frank Keessen wrote:
Hi Guys,
Sorry to trouble you on a saturday night (at least in The Netherlands...)..
Get a parse error on line 42, but i can't see what is causing the trouble. (Parse error: parse error in /home/.sites/95/site92/web/admin/editreis.php on line 42)
if(is_array($_POST['accomodatieid'])) {
foreach($_POST['accomodatieid'] as $Key => $Value) {
$query = 'INSERT INTO ttra(reisid, accomodatieid) VALUES ('. $id2 .', '. $Value .')';
$result = mysql_query($query) or die ("Error in query: $query. " . mysql_error());
};
} else {
$query = 'INSERT INTO ttra(reisid, accomodatieid) VALUES ('$id2', '.$_POST['accomodatieid'].')'; <- THIS IS LINE 42
$result = mysql_query($query) or die ("Error in query: $query. " . mysql_error());
}
Thanks for the help!
Regards,
Frank
if(is_array($_POST['accomodatieid'])) {
foreach($_POST['accomodatieid'] as $Key => $Value) {
$query = "INSERT INTO ttra(reisid, accomodatieid) VALUES ('" . $id2 . "', '" . $Value . "')";
$result = mysql_query($query) or die ("Error in query: $query. " . mysql_error());
}
} else {
$query = "INSERT INTO ttra(reisid, accomodatieid) VALUES ('" . $id2 . "', '" . $_POST['accomodatieid'] . "')";
$result = mysql_query($query) or die ("Error in query: $query. " . mysql_error());
}