illusions
February 27th, 2003, 07:01 PM
I get this error.. And I can't find out what's wrong..
Parse error: parse error, unexpected ';' in g:\apache\www\guestbook.php on line 44
Here's the code where the error is. (the table line is 37, error in 44, but the ";" can't be the error.. or?)
<br>
<table bgcolor="#AAAAAA" border="0" Width="75%" cellspacing="1" cellpadding="2"><br>
<?php<br>
$query = "SELECT * FROM guestbook ORDER BY date_auto";<br>
$result = mysql_query($query, $connection);
<p> for ($i = 0; $i < mysql_num_rows($result); $i++)<br>
(<br>
$name = mysql_result($result, $i, "name"); //Line 44 <br>
$email = mysql_result($result, $i, "email");<br>
$email_len = strlen($email);<br>
$comment = mysql_result($result, $i, "comment");<br>
$date = mysql_result($result, $i, "date_auto");<br>
$show_date = date("H:i:s d/m/y", $date);</p>
<p> echo '<tr><td bgcolor="#EEEEEE"><br>
<font> face="verdana" size="2">';<br>
if ($email > 0)<br>
{<br>
echo '<b>Name:</b> <a href="mailto:' . $email . '">'
. $name . '</a>';<br>
}<br>
else<br>
{<br>
echo '<b>Name:</b> '. $name;<br>
}<br>
echo '<br>
<br><br>
<b>Comment:</b> ' . $comment .'</font><br>
<td><br>
<td widht="1%" valign="top" nowrap bgcolor="#EEEEEE"><br>
<font><br>
<b>Date: </b>' . $show_date .'<br>
</font><br>
</td><br>
</tr><br>
';<br>
)<br>
?><br>
</table>
Parse error: parse error, unexpected ';' in g:\apache\www\guestbook.php on line 44
Here's the code where the error is. (the table line is 37, error in 44, but the ";" can't be the error.. or?)
<br>
<table bgcolor="#AAAAAA" border="0" Width="75%" cellspacing="1" cellpadding="2"><br>
<?php<br>
$query = "SELECT * FROM guestbook ORDER BY date_auto";<br>
$result = mysql_query($query, $connection);
<p> for ($i = 0; $i < mysql_num_rows($result); $i++)<br>
(<br>
$name = mysql_result($result, $i, "name"); //Line 44 <br>
$email = mysql_result($result, $i, "email");<br>
$email_len = strlen($email);<br>
$comment = mysql_result($result, $i, "comment");<br>
$date = mysql_result($result, $i, "date_auto");<br>
$show_date = date("H:i:s d/m/y", $date);</p>
<p> echo '<tr><td bgcolor="#EEEEEE"><br>
<font> face="verdana" size="2">';<br>
if ($email > 0)<br>
{<br>
echo '<b>Name:</b> <a href="mailto:' . $email . '">'
. $name . '</a>';<br>
}<br>
else<br>
{<br>
echo '<b>Name:</b> '. $name;<br>
}<br>
echo '<br>
<br><br>
<b>Comment:</b> ' . $comment .'</font><br>
<td><br>
<td widht="1%" valign="top" nowrap bgcolor="#EEEEEE"><br>
<font><br>
<b>Date: </b>' . $show_date .'<br>
</font><br>
</td><br>
</tr><br>
';<br>
)<br>
?><br>
</table>