for my mini forum I have a “topics” table with fields id(int), title(txt) and post(txt) and I am trying to get the user to see different pages depending on the topics they click on via topicPage.php:
<?
//send a query to retrieve all titles from the topics database
$query = "SELECT * FROM topics" ;
$result = mysql_query($query) or die ("something went wrong with this query");
?>
<span class="subtext"> <?
while($row = mysql_fetch_array($result))
{
echo "<a href = 'topicPage.php?tid=$row['id']'>" .$row['title']. " </a>"." <br>" ." <br>";
}
?>
I get a parse error on the line with the echo function.
Here’s the exact error:
Parse error: syntax error, unexpected T_ENCAPSED_AND_WHITESPACE, expecting T_STRING or T_VARIABLE or T_NUM_STRING in /index.php on line 85
The following part :
is too complex.
You must help PHP find out what is the variable, using the Complex (curly) syntax :