Hi, can someone check this code for me, whenever I try to use it it comes up with this errors:
Warning: mysql_fetch_array(): supplied argument is not a valid MySQL result resource in c:\inetpub\ on line 18
Warning: mysql_fetch_array(): supplied argument is not a valid MySQL result resource in c:\inetpub\ on line 41
::Code::
any ideas??
Thanx
Martin
Warning: mysql_fetch_array(): supplied argument is not a valid MySQL result resource in c:\inetpub\ on line 18
Warning: mysql_fetch_array(): supplied argument is not a valid MySQL result resource in c:\inetpub\ on line 41
::Code::
Code:
<?php
// start the session
session_start();
header("Cache-control: private"); //IE 6 Fix
?>
<html>
<head>
<title>Untitled Document</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
</head>
<?php include ("config1.php");
$conn = mysql_connect($host, $user, $pass); // DO NOT CHANGE THIS
mysql_select_db($db, $conn); // DO NOT CHANGE THIS
$query = mysql_query("SELECT * FROM messages WHERE to = '".$_SESSION['name']."'");
while ($r = mysql_fetch_array($query)){
$new = $r["new"];
if($new > 0)
{
echo("<bgsound src=youhavemail.mp3>");
}
if($new == 0)
{
echo("<bgsound src=>");
}
}
?>
<body>
<?php
$user = $_SESSION['name'];
include ("config1.php");
$conn = mysql_connect($host, $user, $pass); // DO NOT CHANGE THIS
mysql_select_db($db, $conn); // DO NOT CHANGE THIS
$query2 = mysql_query("SELECT * FROM messages WHERE to = 'MJB3000'");
while ($r = mysql_fetch_array($query2)){
$title = $r["title"];
$new = $r["new"];
$nm += $new;
echo("<a href=inbox.php>You have $nm message(s) in you Inbox</a>");
echo("$title");
}
?>
<a href="login.php">Login </a>
</body>
</html>
Thanx
Martin