Code: Select all
,Code: Select all
and [syntax="..."] tags where appropriate when posting code. Your post has been edited to reflect how we'd like it posted. Please read: [url=http://forums.devnetwork.net/viewtopic.php?t=21171]Posting Code in the Forums[/url] to learn how to do it too.[/color]
Hello, I am creating a timedelay for an email mailing list. The code I have now without the time delay works:Code: Select all
$headers = "From: $from\r\n";
$headers .= "Content-type: text/html\r\n";
include_once ("config.php");
//Get emails from email List
$result = mysql_query("SELECT email FROM db_tbl WHERE status = '1'");
if (!$result) {
echo 'Could not run query: ' . mysql_error();
exit;
}
while ($row = mysql_fetch_object($result)) {
echo $row->email;
mail($row->email, $subject, $message, $headers);
}
mysql_free_result($result);
?>Code: Select all
$headers = "From: $from\r\n";
$headers .= "Content-type: text/html\r\n";
include_once ("config.php");
$x =1;
$hold =10;
do{
//Get emails from Latest_Ladies_email List
$result = mysql_query("SELECT email FROM db_tbl WHERE status = '1'");
if (!$result) {
echo 'Could not run query: ' . mysql_error();
exit;
}
$x++;
if($x == $hold) {
set_time_limit(30);
sleep(3);
$x = 0;
}
}
while ($row = mysql_fetch_object($result)) {
echo $row->email;
mail($row->email, $subject, $message, $headers);
}
mysql_free_result($result);
?>Code: Select all
Parse error: parse error, unexpected '{', expecting ';' in /home/russia5/public_html/mailer/APEX_mime.php on line 154Can anyone see the syntax error I am making.
Thanks to all that try to help me!
Greg
feyd | Please use
Code: Select all
,Code: Select all
and [syntax="..."] tags where appropriate when posting code. Your post has been edited to reflect how we'd like it posted. Please read: [url=http://forums.devnetwork.net/viewtopic.php?t=21171]Posting Code in the Forums[/url] to learn how to do it too.[/color]