draftermath Posted February 22, 2007 Share Posted February 22, 2007 i am stuck on this, Parse error: parse error, unexpected T_ECHO, expecting ',' or ';' in C:\wamp\www\s2007\view_a.php on line 21 <?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'; ?> line 21 is echo $row['description']; but everything looks good to me Link to comment https://forums.phpfreaks.com/topic/39678-solved-parse-error-parse-error-unexpected-t_echo-please-help/ Share on other sites More sharing options...
magic2goodil Posted February 22, 2007 Share Posted February 22, 2007 echo "<tr><td bgcolor="#CCCCCC"><div align=\"center\">"; You left backslashes out around your hex coloe code. Change to: echo "<tr><td bgcolor=\"#CCCCCC\"><div align=\"center\">"; Link to comment https://forums.phpfreaks.com/topic/39678-solved-parse-error-parse-error-unexpected-t_echo-please-help/#findComment-191551 Share on other sites More sharing options...
kenrbnsn Posted February 22, 2007 Share Posted February 22, 2007 You didn't escape all the quotes in this line: <?php echo "<tr><td bgcolor="#CCCCCC"><div align=\"center\">"; ?> Write it either as <?php echo "<tr><td bgcolor=\"#CCCCCC\"><div align=\"center\">"; ?> or <?php echo '<tr><td bgcolor="#CCCCCC"><div align="center">'; ?> I prefer the latter way, since you don't have to worry about escaping the double quotes. Ken Link to comment https://forums.phpfreaks.com/topic/39678-solved-parse-error-parse-error-unexpected-t_echo-please-help/#findComment-191552 Share on other sites More sharing options...
draftermath Posted February 22, 2007 Author Share Posted February 22, 2007 thanks guys, i works great now. what editor do you guys use for php, i use dreamweaver for some stuff then edit it in notepad, is there any sort of color coded editor for php? Link to comment https://forums.phpfreaks.com/topic/39678-solved-parse-error-parse-error-unexpected-t_echo-please-help/#findComment-191559 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.