draftermath Posted February 22, 2007 Share Posted February 22, 2007 i am trying to hyperlink text to my url variable, but i can't get the syntax of right. the url variable is the hyperlink to the header text. i thought "<a href=\"$row['url']\">"; would work but it does not, i get Parse error: parse error, unexpected T_ENCAPSED_AND_WHITESPACE, expecting T_STRING or T_VARIABLE or T_NUM_STRING in C:\wamp\www\s2007\view_a.php on line 17 row 17 corresponds to echo "<a href=\"$row['url']\">"; my explantion might not be clear but please ask any questions that you have <?php include 'config.php'; include 'opendb.php'; $header = $_GET['header']; $url = $_GET['url']; $description = $_GET['description']; $results = mysql_query("SELECT * FROM articles") or die(mysql_error()); // keeps getting the next row until there are no more to get while($row = mysql_fetch_array( $results )) { // Print out the contents of each row into a table echo "<table width=\"90%\" border=\"0\" bgcolor=\"#0000CC\">"; echo "<tr><td bgcolor=\"#006699\"><div align=\"center\">"; echo "<a href=\"$row['url']\">"; echo $row['header']"; echo "</a></div></td></tr>"; echo "<tr><td bgcolor="#CCCCCC"><div align=\"center\"> echo $row['description']; echo "</div></td></tr>"; } echo "</table>"; include 'closedb.php'; ?> Link to comment https://forums.phpfreaks.com/topic/39671-help-displaying-double-quotes-in-php/ Share on other sites More sharing options...
papaface Posted February 22, 2007 Share Posted February 22, 2007 change it to: echo '<a href="'.$row["url"].'">'; Link to comment https://forums.phpfreaks.com/topic/39671-help-displaying-double-quotes-in-php/#findComment-191517 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.