Href error

I am having a syntax error(bolded) with this line of code. Help needed!!! I am new to php!

By the way, this line of code is in a while loop.

while($row = mysql_fetch_array($result)){   //Creates a loop to loop through results
echo "<tr><td>" . $row['id'] . "</td><td>" . $row['date'] . "</td><td>" . $row['type'] . "</td><td>" . $row['size'] ."</td><td>" . $row['currency_pair'] ."</td><td>" . $row['entry'] ."</td><td>" . $row['stoploss'] ."</td><td>" . $row['takeprofit'] ."</td><td>" . $row['dateclose'] ."</td><td>" . $row['close'] ."</td><td>" . $row['profitloss'] . "</td>[B]<td>"<a href= 'copytrade.php?id= .$row['id'].'">copy</a></td>[/B]</tr>";
}

You’ve got the " in the wrong place in that bold section. Try this:

<td><a href='copytrade.php?id=[COLOR="#FF0000"]"[/COLOR] . $row['id'] . [COLOR="#FF0000"]"'[/COLOR]>copy</a></td>

(I may not have that quite right, but it’s closer. :slight_smile: )

I know Ralph has already answered your question but I can’t bare to see an echo statement mangled together as it makes finding errors harder and quite annoying to update, to counter this (and I know others have their view) but I always recommend you concatenate your echo statement as a string but so each specific TD in your case is on its own line so its clear as to what goes where. Also you shouldn’t put comments after brackets as you will find in the future that it makes your lines very long where as putting them on the line before makes it clear and concise as to what it is your doing.

// Creates a loop to loop through results
while ($row = mysql_fetch_array($result)) {
	echo "<tr>" +
		"    <td>" . $row['id'] . "</td>" +
		"    <td>" . $row['date'] . "</td>" +
		"    <td>" . $row['type'] . "</td>" +
		"    <td>" . $row['size'] ."</td>" +
		"    <td>" . $row['currency_pair'] ."</td>" +
		"    <td>" . $row['entry'] ."</td><" +
		"    <td>" . $row['stoploss'] ."</td>" +
		"    <td>" . $row['takeprofit'] ."</td>" +
		"    <td>" . $row['dateclose'] ."</td>" +
		"    <td>" . $row['close'] ."</td>" +
		"    <td>" . $row['profitloss'] . "</td>" +
		"    <td><a href= 'copytrade.php?id=" . $row['id'] . "'>copy</a></td>" +
		"</tr>";
}

Please don’t take this as me criticising you, its simply some constructive criticism to help you in the future.

I don’t think you want + there. A . OR , would work.