1. Copy the code below.
  2. Open comment.php in the code view. Paste the code below the form (not inside the form tag.
  3. Change 'david' in fourth line to your username.
  4. Upload the page, any comments which have been posted will now appear below the form.

<?php
$conn = mysql_connect("localhost", "wetsoxor_student", "coyote");
mysql_select_db("wetsoxor_davinci", $conn) or die(mysql_error());
$sql = "SELECT * FROM blog where user='david' order by count DESC";
$result=mysql_query($sql, $conn) or die(mysql_error());

while ($newArray = mysql_fetch_array($result)) {
$when = $newArray['when'];
$name = $newArray['name'];
$comment = $newArray['comment'];

print "<hr> On $when &nbsp; $name said<p>$comment</p>";
}
?>

 

 

John celebrates a successful pumpkin drop
Home
Industrial Design
Classes
Mr. C at robotics seminar in New Hampshire
Instructor
Team at 07 nationals with Dean Kamen
Robotics