Also it's coming up with this
( ! ) Warning: mysql_fetch_array() expects parameter 1 to be resource, boolean given in C:\Documents and Settings\Owner\Desktop\canberra amatuer productions\www\Canberra Amatuer Productions\member.php on line 88
Call Stack
# Time Memory Function Location
1 0.0082 383600 {main}( ) ..\member.php:0
2 0.0146 393384 mysql_fetch_array ( ) ..\member.php:88
On this page
Any help would be greatPHP Code:<?php
mysql_connect("localhost", "****", "****") or die(mysql_error());
mysql_select_db("****") or die(mysql_error());
if(isset($_COOKIE['ID_my_site']))
{
$username = $_COOKIE['ID_my_site'];
$pass = $_COOKIE['Key_my_site'];
$check = mysql_query("SELECT * FROM users WHERE username = '$username'")or die(mysql_error());
while($info = mysql_fetch_array( $check ))
{
if ($pass != $info['password'])
{ header("Location: login.php");
}
else
{
}
}
}
else
{
header("Location: login.php");
}
$links = "link2.php";
?>
<?php
mysql_connect("localhost", "****", "****") or die('could not connect to database');
mysql_select_db("****") or die('Could not select database');
if (isset ($_POST['submit']))
{
$comment = nl2br(mysql_escape_string (trim ($_POST['comment'])));
$quantity = $_POST['quantity'];
$item = $_POST['item'];
$cheese = "$username - $comment ";
$sql = mysql_query ("INSERT INTO comments (id,comments) VALUES ('0','".$cheese."')");
echo 'Your comment has been entered successfully!';
echo '<a href="member.php">Please click here</a>';
}
else
{
?>
<html>
<head>
<body style="background-color:lightgreen">
</head>
<body>
<?php include("$links");
echo "Hey ".$username;
?>
<br /><br />
<p><b>COMMENTS</b></p>
<?php
// POST data wasnt entered, so display the comments and comment form
// view comments from database
$sql = mysql_query ("SELECT * FROM comments");
while ($row = mysql_fetch_array ($sql)) {
echo $row['comments'].'<br />';
}
echo '<br /><br />
<form action="member.php" method="post">
Comments:<br />
<textarea name="comment" cols="40" rows="7"></textarea>
<input type="submit" value="Submit" name="submit">
</form>';
}
?>
</body>
</html>



Reply With Quote


Bookmarks