i have created a shoutbox that has two fields...author & message. i have no problem inserting the data into the table but getting it to print is another story. can someone take a look at this and tell me the error(s) in my ways???
<?
// Define post fields into simple variables
$author = $_POST['author'];
$message = $_POST['message'];
/* Let's strip some slashes in case the user entered
any escaped characters. */
$author = stripslashes($author);
$message = stripslashes($message);
/// Enter info into the Database.
$sql = mysql_query("INSERT INTO shoutbox (author, message, date)
VALUES('$author', '$message', now())") or die (mysql_error());
mysql_query($sql);
// Show thanks message and take them back to the main shoutbox
echo "Thanks for your post<BR>";
// Set the query as $query, and get the last 10 posts.
$query = "SELECT author, message FROM shoutbox order by date";
$result = mysql_query($query);
print "<iframe>\n";
print "$result";
print "</iframe>\n";
/* Results */
mysql_free_result($result);
?>