954,604 Members — Technology Publication meets Social Media
Username:
Password:
Lost login information?
Have something to say? Contribute New Article Reply to this Article

Parse error: parse error, expecting `T_STRING' or `T_VARIABLE' or `T_NUM_STRING'

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

QWaz
Junior Poster in Training
62 posts since Apr 2010
Reputation Points: 10
Solved Threads: 0
 

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

rajarajan07
Nearly a Posting Virtuoso
1,447 posts since May 2008
Reputation Points: 167
Solved Threads: 239
 

Hello, Iget the same error for this code:

$query="insert into users(email,psw,city,country) values($HTML['email'],$HTML['password'],$HTML['city'],$HTML['countryID'])";
$result = mysql_query($query, $GLOBALS['DB']);

can someone help please.

rse
Light Poster
28 posts since Nov 2011
Reputation Points: 10
Solved Threads: 0
 

This question has already been solved

Post: Markdown Syntax: Formatting Help
You