a-one a-one - 1 year ago 94
PHP Question

passing sql row result as key in url

I am trying to pass a sql row result as a key into an url.

I am getting the following error:

Parse error: syntax error, unexpected '' (T_ENCAPSED_AND_WHITESPACE),
expecting identifier (T_STRING) or variable (T_VARIABLE) or number

with my php line :

echo "<td>" . "<a href=\"viewDetails.php?"."$row['title']"."\>Betterdisplay</a>" . "</td>";

Answer Source

You have made a small error in your string concatenation

echo "<td>" . "<a href=\"viewDetails.php?".$row['title']."\">Betterdisplay</a>" . "</td>";
Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download