...

View Full Version : Delayed AutoResponder Errors



selfxemployed
05-08-2009, 12:00 AM
[07-May-2009 16:20:01] PHP Warning: mysql_fetch_row(): supplied argument is not a valid MySQL result resource in /home/sandip89/public_html/email/autoresponder.php on line 44

[07-May-2009 16:21:14] PHP Parse error: syntax error, unexpected T_IF in /home/sandip89/public_html/email/autoresponder.php on line 45

Here's lines 40-50


function PutInTheQueue($email)
{
global $database;
if (mysql_fetch_row(mysql_query("select * from {$database['table']} where `account`=".mslash($email['account'])." AND message_id=".mslash($email['message_id']))))
return true;//already in queue
$email['duetime'] = date("Y-m-d H:i:s",$email['duetime']);
return mysql_query(InsertSQL($database['table'],$email));
}
//------------------------------------------------------------------------------
function mslash($s)

Stooshie
05-08-2009, 06:19 PM
I haven't seen the curly braces in:


... from {$database['table']} where ...
[/code/
used that way in php before. I would tend to do:
[code]
... from ".$database['table']." where ...


Also the:


... where `account`= ...

is using the weird MS single apostrophes. I would miss them out and do:


... where account= ...


Other than that I can't see anything else particularly wrong.

Altered code:


function PutInTheQueue($email)
{
global $database;
if(
mysql_fetch_row(
mysql_query(
"select
*
from
".$database['table']."
where
account'=".mslash($email['account'])."
AND
message_id=".mslash($email['message_id'])
)
)
)
{
return true;//already in queue
}
$email['duetime'] = date("Y-m-d H:i:s",$email['duetime']);
return mysql_query(InsertSQL($database['table'],$email));
}
//------------------------------------------------------------------------------
function mslash($s)


I can't test it as I don't have access to your DB. let me know how it goes.



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum