Jump to content
MakeWebGames

Recommended Posts

Posted

Hey, I've been working on a mail script and keep coming accross little errors.

I've fixed most of them but now I'm getting this one:

Warning: mysql_fetch_array() expects parameter 1 to be resource, boolean given in C:\wamp\www\***\mail.php on line 39

I don't understand because my mysql_fetch_array() is bringing resources :/

If anyone can point me the right way i'd be very happy :)

Heres the code:

$_MailRun = mysql_query("SELECT * from `mails` ORDER BY `time` DESC");

//this is line 39
while ($_Mails = mysql_fetch_array($_MailRun, MYSQL_ASSOC)) 
{

   if ($_Mails['to'] == $_USER['id']) 
{
    $_MailsFrom = $_USERMAILFROMcol['username'];
 $subject = ($_Mails['subj'] == "") ? "No Subject" : $_Mails['subj'];
 if ($_Mails['seen']=="1")
 {
	 $_MailSeen="No";
 }
 else
 {
	 $_MailSeen="Yes";
 }
   echo "

					<tr>

						<td colspan='25%'>".date(F." ".d.", ".Y." ".g.":".i.":".sa,$_Mails['time'])."</td>

						<td width='25%'><a href='mail.php?mail=read'>".$subject."</a></td>

						<td width='25%'>".$_MailsFrom['username']."</td>

						<td width='25%'>".$_MailSeen."</td>

						<td><a href='mails.php?mail=delete'>Delete</a></td>

					</tr>



";

}

}
?>

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...