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

Member Avatar for rajarajan2017

For your sql query use double quotes " instead of single quote '

Hello, Iget the same error for this code:

$query="insert into users(email,psw,city,country) values($HTML,$HTML,$HTML,$HTML)";
$result = mysql_query($query, $GLOBALS);

can someone help please.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.