so, i started at php and i'm doing some exercises from the book, but when i type this code into my "view.php", the output is all wrong...
<?php include("dbconnect.php") ?>
<h2>View my GuestBook!!</h2>
<?php
$result=mysql_query("select * from guestbook")
or die(mysql_error());
while ($row=mysql_fetch_array($result))
{
echo "<b>Name:</b>";
echo $row["name"];
echo "<br>\n";
echo "<b>Location:</b>";
echo $row["location"];
echo "<br>\n";
echo "<b>Email:</b>";
echo $row["email"];
echo "<br>\n";
echo "<b>URL:</b>";
echo $row["url"];
echo "<br>\n";
echo "<b>Comments:</b>";
echo $row["comments"];
echo "<br>\n";
echo "<br>\n";
echo "<br>\n";
}
mysql_free_result($reslut);
?>
the output is like this:
View my GuestBook!!
Name:"; echo $row["name"]; echo "
\n"; echo "Location:"; echo $row["location"]; echo "
\n"; echo "Email:"; echo $row["email"]; echo "
\n"; echo "URL:"; echo $row["url"]; echo "
\n"; echo "Comments:"; echo $row["comments"]; echo "
\n"; echo "
\n"; echo "
\n"; } mysql_free_result($reslut); ?>