need help with references
| From: | motorpsychkill | Date: | Mon, 09 Feb 2004 20:12:23 +0000 |
| Subject: | need help with references | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-177232@lists.php.net to get a copy of this message | ||
Hi,
I'm having trouble with the code below. Basically, I'm trying to set up
$message to inherit one of two forms depending on if there is a $_GET
request. The script works IF there is a $_GET request. It fails if there
isn't (i.e. parse error).
Is there a way to get $message to refer to include multiple references like
below? Thank you!
-m
<?
if ($_GET['id']){
$query = "select * from bc_help where help_id = '" . $_GET['id'] .
"' ";
$message = & $body;
}
else {
$query = "select * from bc_help";
$message = "<ol>" . & $links . "</ol>" . & $body; // This
is where the
trouble is.
}
$results = db_query($query);
while ($row = db_fetch_array($results)){
$links .= "<li><a class=internal href=#" . $row['help_id'] .
">" .
$row['help_topic'] . "</a></li>\n";
$body .= "<a name=" . $row['help_id'] . "><b>" .
$row['help_topic'] .
"</b><br><br>" . $row['help_text'] .
"</a><br><br><br>";
}
echo $message;
?>