Hi,
I am pretty new to php.
I am trying to get a result from a database display as a link with php tags in it. however I am getting this error:
Parse error: parse error, expecting `T_STRING' or `T_VARIABLE' or `T_NUM_STRING' on line 53
I don't know what it's for, My code is below.
$sql='SELECT round FROM fixtures_results WHERE team = '.$teamName.' ORDER BY job_id DESC;';
$pds=$conn->query($sql);
$round=array();
foreach($pds as $row) { // this and $pds=$pdo->query($sql) could be done in one step like this: foreach($pdo->query($sql) as $row) {
$round[]=<<<END
<div class="selectButton"><a href="fixturesRound.php?user=<?php echo $_GET['user']; ?>.&team=<?php echo str_replace(" ","+",$teamName); ?>&round=[$row[round]]">[$row[round]]</a></div> // THIS IS LINE 53, the one the error is on.
END;
}
$round=implode("\r\n",$round);
Does anyone know why it's happening?
I have also tried it like this:
<div class="selectButton"><a href="fixturesRound.php?user='$_GET['user']'&team='str_replace(" ","+",$teamName)'&round=[$row[round]]">[$row[round]]</a></div>
The end goal is to get the number or rounds that are associated with the team display.
Is this how it should be done or am I on the complete wrong track?
Cheers,
Qwaz