loserWILL
02-01-2008, 05:36 PM
I have the following code, and it keeps giving me this error:
Parse error: syntax error, unexpected T_CHARACTER, expecting T_STRING or T_VARIABLE or T_NUM_STRING in /home/stay/public_html/loser/admin/viewall.php on line 214Line 214 is:
<div id=\"news_top\"><div align=\"left\"><div id=\"title\">$title - <a href=\"edit.php?id=<?php echo(\"\" . $fetch[\"id\"] . \"\");?>\">edit</a></div></div></div>+rep to all suggestions.
<?php
// Database
include "config.php";
// Lets check the mySQL
$sql = "SELECT * FROM news";
$check = mysql_query("SELECT id, title, name, date, post FROM news") or die("Onoes! Something is wrong! Please contact loserWILL for assistance (this is an error).");
//Now, define the content variable(s)
while ($display = mysql_fetch_array($check)) {
$title = $display['title'];
$name = $display['name'];
$date = $display['date'];
$post = $display['post'];
//Lets display it!
echo "<div id=\"news_wrap\">
<div id=\"news_top\"><div align=\"left\"><div id=\"title\">$title - <a href=\"edit.php?id=<?php echo(\"\" . $fetch[\"id\"] . \"\");?>\">edit</a></div></div></div>
<div id=\"news_middle\"><div id=\"text2\">$post</div>
<div id=\"etc\">Posted by: <strong>$name</strong> on <strong>$date</strong>.</div></div>
<div id=\"news_bottom\"></div>
</div>";
}
?>
Moved by Agesilaus (Forum Moderator) from Designing & Development: Please post in the correct forum next time. :)
Parse error: syntax error, unexpected T_CHARACTER, expecting T_STRING or T_VARIABLE or T_NUM_STRING in /home/stay/public_html/loser/admin/viewall.php on line 214Line 214 is:
<div id=\"news_top\"><div align=\"left\"><div id=\"title\">$title - <a href=\"edit.php?id=<?php echo(\"\" . $fetch[\"id\"] . \"\");?>\">edit</a></div></div></div>+rep to all suggestions.
<?php
// Database
include "config.php";
// Lets check the mySQL
$sql = "SELECT * FROM news";
$check = mysql_query("SELECT id, title, name, date, post FROM news") or die("Onoes! Something is wrong! Please contact loserWILL for assistance (this is an error).");
//Now, define the content variable(s)
while ($display = mysql_fetch_array($check)) {
$title = $display['title'];
$name = $display['name'];
$date = $display['date'];
$post = $display['post'];
//Lets display it!
echo "<div id=\"news_wrap\">
<div id=\"news_top\"><div align=\"left\"><div id=\"title\">$title - <a href=\"edit.php?id=<?php echo(\"\" . $fetch[\"id\"] . \"\");?>\">edit</a></div></div></div>
<div id=\"news_middle\"><div id=\"text2\">$post</div>
<div id=\"etc\">Posted by: <strong>$name</strong> on <strong>$date</strong>.</div></div>
<div id=\"news_bottom\"></div>
</div>";
}
?>
Moved by Agesilaus (Forum Moderator) from Designing & Development: Please post in the correct forum next time. :)