Hi,
When I open a page that has the PHP code below, I get the following error message: Resource id #2Resource id #2
As I currently have my site set up, I am runnning the PHP script as soon as the page has loaded. Ideally, I would like to put the code below in the same page where a user can submitdata to the database. After the submit button has been clicked, the new data is added to the database table and all records in the table are printed.
I would appreciate someone's help on this.
Many thanks,
Sean
<html>
<head>
<title>Untitled Document</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
</head>
<body>
<?php
include('connect.php');
//if ($_POST) {
// the text below inserts the form data into the player1 table
$sql = "select *
from fan";
$result = mysql_query($sql, $conn);
if ($result) {
print $message = $result;
}
else {
$message = "Their are no entries in the database";
};
print $message;
mysql_close($conn);
//} //end if $_POST
?>
</body>
</html>