Sware Posted July 3, 2006 Share Posted July 3, 2006 [code]<?PHP //MYSQL CONNECTION$dbh=mysql_connect ("localhost", "XXXX", "XXXXXX") or die ('I cannot connect to the database because: ' . mysql_error());mysql_select_db ("sware_phpb2");$query = "SELECT phpbb_users.username, phpbb_posts_text.post_subject, phpbb_posts_text.post_text, phpbb_posts.post_id, phpbb_posts.topic_id, phpbb_posts.forum_id FROM phpbb_users JOIN phpbb_posts ON phpbb_posts.poster_id = phpbb_users.user_id JOIN phpbb_posts_text ON phpbb_posts.post_id = phpbb_posts_text.post_id ORDER BY post_id DESC"; $result = mysql_query($query) or die(mysql_error());// Contents while($row = mysql_fetch_array($result)){ echo "<br>"; echo "<table border="0" cellpadding="0" cellspacing="2" width="510" class="pageoutline">"; echo "<tr>"; echo "<td width="504" height="19" valign="top" bgcolor="#A3C159"><div align="center" class="navtitle">"; echo "<div align="center">". $row['post_subject'] ."</div>"; echo "</div></td>"; echo "</tr>"; echo "<tr>"; echo "<td height="45" valign="top">""; echo "Posted By:". $row['username'] ."."; echo "<p align="center">". $row['post_text'] ."; echo "<br>"; echo "</tr>"; echo "</table>"; }?>[/code]It says [code]Parse error: syntax error, unexpected T_LNUMBER, expecting ',' or ';' in /home/sware/public_html/test.php on line 13[/code]Line 13 is [code] echo "<table border="0" cellpadding="0" cellspacing="2" width="510" class="pageoutline">";[/code] Quote Link to comment Share on other sites More sharing options...
bearruler Posted July 3, 2006 Share Posted July 3, 2006 When you echo a line, you cant have quotes in that line. php will see those quotes as ending the text its echoing, and going back into php syntaxTo echo a quote character, use \"[code]echo "<table border="0" cellpadding="0" cellspacing="2" width="510" class="pageoutline">";[/code]Should be [code]echo "<table border=\"0\" cellpadding=\"0\" cellspacing=\"2\" width=\"510\" class=\"pageoutline\">";[/code]or[code]echo "<table border=0 cellpadding=0 cellspacing=2 width=510 class=pageoutline>";[/code]or[code]?><table border="0" cellpadding="0" cellspacing="2" width="510" class="pageoutline"><?[/code]And this is the mysql (database) forum. Syntax errors should go in the basic php help forumBear Quote Link to comment Share on other sites More sharing options...
fenway Posted July 3, 2006 Share Posted July 3, 2006 Or use singles for the outside and doubles on the inside.[code]echo '<table border="0" cellpadding="0" cellspacing="2" width="510" class="pageoutline">';[/code]But agreed, this isn't a MySQL-related issue. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.