PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!
Moderator: General Moderators
AnsonM
Forum Commoner
Posts: 72 Joined: Thu Sep 25, 2003 7:21 am
Post
by AnsonM » Wed Feb 18, 2004 4:17 am
Code: Select all
<?php
echo("<table width="100%">
<tr>
<td class="menu_heading"><b><center> -[[ Subject: " . $x["title"] . " // Posted on: " . $x["date"] . " @ " . $x["time"] . "By: " . $x["admin"] . "]]-
</center>
</b>
</td>
</tr>
<tr>
<td class="news_content"><center>" . $x["news"] . "</td></center></tr>");
}
?>
parse error on line 12
AnsonM
Forum Commoner
Posts: 72 Joined: Thu Sep 25, 2003 7:21 am
Post
by AnsonM » Wed Feb 18, 2004 4:18 am
Line 12 is... echo("<table width="100%">
AnsonM
Forum Commoner
Posts: 72 Joined: Thu Sep 25, 2003 7:21 am
Post
by AnsonM » Wed Feb 18, 2004 4:20 am
heres the first few lines... cuz it doesnt make sense if you just read part of it...
Code: Select all
<?
$sql = 'SELECT `id` , `date` , `time` , `title` , `news` , `admin` ';
$sql .= 'FROM `news` ';
$sql .= 'WHERE 1 LIMIT 0, 30';
$result = mysql_query($sql);
if (!$result) {
echo("<p>Error performing query: " . mysql_error() . "</p>");
exit();
}
// Display the NEWS
while($x = mysql_fetch_array($result)) {
echo("<table width="100%">
<tr>
<td class="menu_heading"><b><center> -[[ Subject: " . $x["title"] . " // Posted on: " . $x["date"] . " @ " . $x["time"] . "By: " . $x["admin"] . "]]-
</center>
</b>
</td>
</tr>
<tr>
<td class="news_content"><center>" . $x["news"] . "</td></center></tr>");
}
?>
AnsonM
Forum Commoner
Posts: 72 Joined: Thu Sep 25, 2003 7:21 am
Post
by AnsonM » Wed Feb 18, 2004 4:37 am
Fixed myself...
Code: Select all
<?
$sql = 'SELECT `id` , `date` , `time` , `title` , `news` , `admin` ';
$sql .= 'FROM `news` ';
$sql .= 'WHERE 1 LIMIT 0, 30';
$result = mysql_query($sql);
if (!$result) {
echo("<p>Error performing query: " . mysql_error() . "</p>");
exit();
}
// Display the NEWS
while($x = mysql_fetch_array($result)) {
echo("<table width="100%">
<tr>
<td class="menu_heading"><b><center> -[[ Subject: " . $x["title"] . " // Posted on: " . $x["date"] . " @ " . $x["time"] . "By: " . $x["admin"] . "]]-
</center>
</b>
</td>
</tr>
<tr>
<td class="news_content"><center>" . $x["news"] . "</td></center></tr><br><br>");
}
?>