Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7030507
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T00:40:47+00:00 2026-05-28T00:40:47+00:00

I have some problems with my script below, I am getting the following warnings,

  • 0

I have some problems with my script below, I am getting the following warnings, which I presume means the results of the query are null ? The thing is though, if I run the code query itself in the MySQL console I get back results ?

Warning: mysql_fetch_array() expects parameter 1 to be resource, null given in C:\server2go    \server2go\htdocs\chandlers\components\com_jumi\views\application\view.html.php(38) :     eval()'d code on line 53

Warning: mysql_fetch_array() expects parameter 1 to be resource, null given in C:\server2go    \server2go\htdocs\chandlers\components\com_jumi\views\application \view.html.php(38) :    eval()'d code on line 93

Warning: mysql_fetch_array() expects parameter 1 to be resource, null given in C:\server2go    \server2go\htdocs\chandlers\components\com_jumi\views\application\view.html.php(38) :     eval()'d code on line 134

Warning: mysql_fetch_array() expects parameter 1 to be resource, null given in C:\server2go    \server2go\htdocs\chandlers\components\com_jumi\views\application\view.html.php(38) :     eval()'d code on line 177

Warning: mysql_fetch_array() expects parameter 1 to be resource, null given in C:\server2go    \server2go\htdocs\chandlers\components\com_jumi\views\application\view.html.php(38) :     eval()'d code on line 218

Warning: mysql_fetch_array() expects parameter 1 to be resource, null given in C:\server2go    \server2go\htdocs\chandlers\components\com_jumi\views\application\view.html.php(38) :     eval()'d code on line 259




    <?php                 
        // SETS THE TIMEZONE TO UK TIME
        date_default_timezone_set('Europe/London');

        // DEFINES WEEKDAY AND DAY OF THE MONTH
        $weekday = date('D');
        $dayOfMonth = date('d');

        // RUNS THE EVERY DAY FUNCTIONS TO MAIL USERS IN THAT GROUP EVERY DAY
        gasoildailyemailer();
        dervdailyemailer();
        kerodailyemailer();
        if ($weekday == 'Mon')
        {

        // RUNS THE WEEKLY FUNCTIONS TO MAIL USERS IN THAT GROUP EVERY WEEK
         gasoilweeklyemailer();
         dervweeklyemailer();
         keroweeklyemailer();
        if ($dayOfMonth <=6) {

        // RUNS THE MONTHLY FUNCTIONS TO MAIL USERS IN THAT GROUP EVERY MONTH
        gasoilmonthlyemailer();
        dervmonthlyemailer();
        keromonthlyemailer(); }
        }

        ?>


    <?php
    //start of gas oil daily emailer
    function gasoildailyemailer(){
    require_once('./send/class.phpmailer.php');
    //include("class.smtp.php"); // optional, gets called from within class.phpmailer.php if not already loaded

    $mail = new PHPMailer(true); //defaults to using php "mail()"; the true param means it will throw exceptions on errors, which we need to catch

    // $body                = file_get_contents('contents.html');

    $body = 'Dear Test this is a test.';

    // $body = preg_replace('/\\\\/i', $body);

    $mail->SetFrom('crea@cruiseit.co.uk', 'List manager');
    $mail->AddReplyTo('crea@cruiseit.co.uk', 'List manager');

    $mail->Subject       = "Mailing List Test";

    $gasoil_daily_users = mysql_query("SELECT leadname , email FROM hqfjt_chronoforms_data_addupdatelead WHERE receivegasoilmailinglist = 'everyday'") or die(mysql_error());
    $result = @MYSQL_QUERY($gasoil_daily_users);

    while ($row = mysql_fetch_array ($result)) {
      $mail->AltBody    = "To view the message, please use an HTML compatible email viewer!"; // optional, comment out and test
      $mail->MsgHTML($body);
      $mail->AddAddress($row["email"], $row["leadname"]);
      $mail->AddStringAttachment($row["photo"], "YourPhoto.jpg");

      if(!$mail->Send()) {
        echo "Mailer Error (" . str_replace("@", "&#64;", $row["email"]) . ') ' . $mail->ErrorInfo . '<br>';
      } else {
        echo "Message sent to :" . $row["full_name"] . ' (' . str_replace("@", "&#64;", $row["email"]) . ')<br>';
      }
      // Clear all addresses and attachments for next loop
      $mail->ClearAddresses();
      $mail->ClearAttachments();
    }
    };
    ?>    

    <?php
    // START OF DERV DAILY EMAILER
    function dervdailyemailer(){
    require_once('./send/class.phpmailer.php');
    //include("class.smtp.php"); // optional, gets called from within class.phpmailer.php if not already loaded

    $mail = new PHPMailer(true); //defaults to using php "mail()"; the true param means it will throw exceptions on errors, which we need to catch

    // $body                = file_get_contents('contents.html');

    $body = 'Dear Test this is a test.';

    // $body = preg_replace('/\\\\/i', $body);

    $mail->SetFrom('crea@cruiseit.co.uk', 'List manager');
    $mail->AddReplyTo('crea@cruiseit.co.uk', 'List manager');

    $mail->Subject       = "Mailing List Test";

    $derv_daily_users = mysql_query("SELECT leadname , email FROM hqfjt_chronoforms_data_addupdatelead WHERE receivedervmailinglist = 'everyday'") or die(mysql_error());
    $result1 = @MYSQL_QUERY($derv_daily_users);

    while ($row = mysql_fetch_array ($result1)) {
      $mail->AltBody    = "To view the message, please use an HTML compatible email viewer!"; // optional, comment out and test
      $mail->MsgHTML($body);
      $mail->AddAddress($row["email"], $row["leadname"]);
      $mail->AddStringAttachment($row["photo"], "YourPhoto.jpg");

      if(!$mail->Send()) {
        echo "Mailer Error (" . str_replace("@", "&#64;", $row["email"]) . ') ' . $mail->ErrorInfo . '<br>';
      } else {
        echo "Message sent to :" . $row["full_name"] . ' (' . str_replace("@", "&#64;", $row["email"]) . ')<br>';
      }
      // Clear all addresses and attachments for next loop
      $mail->ClearAddresses();
      $mail->ClearAttachments();
    }
    };
    // end of DERV daily emailer
    ?>    

    <?php
    //start of KERO daily emailer
    function kerodailyemailer(){
    require_once('./send/class.phpmailer.php');
    //include("class.smtp.php"); // optional, gets called from within class.phpmailer.php if not already loaded

    $mail = new PHPMailer(true); //defaults to using php "mail()"; the true param means it will throw exceptions on errors, which we need to catch

    // $body                = file_get_contents('contents.html');

    $body = 'Dear Test this is a test.';

    // $body = preg_replace('/\\\\/i', $body);

    $mail->SetFrom('crea@cruiseit.co.uk', 'List manager');
    $mail->AddReplyTo('crea@cruiseit.co.uk', 'List manager');

    $mail->Subject       = "Mailing List Test";

    $kero_daily_users = mysql_query("SELECT leadname , email FROM hqfjt_chronoforms_data_addupdatelead WHERE receivekeromailinglist = 'everyday'") or die(mysql_error());
    $result2 = @MYSQL_QUERY($kero_daily_users);

    while ($row = mysql_fetch_array ($result2)) {
      $mail->AltBody    = "To view the message, please use an HTML compatible email viewer!"; // optional, comment out and test
      $mail->MsgHTML($body);
      $mail->AddAddress($row["email"], $row["leadname"]);
      $mail->AddStringAttachment($row["photo"], "YourPhoto.jpg");

      if(!$mail->Send()) {
        echo "Mailer Error (" . str_replace("@", "&#64;", $row["email"]) . ') ' . $mail->ErrorInfo . '<br>';
      } else {
        echo "Message sent to :" . $row["full_name"] . ' (' . str_replace("@", "&#64;", $row["email"]) . ')<br>';
      }
      // Clear all addresses and attachments for next loop
      $mail->ClearAddresses();
      $mail->ClearAttachments();
    }
    };
    // end of KERO daily emailer
    ?>    



    <?php
    // start of GAS OIL WEEKLY emailer
    function gasoilweeklyemailer(){
    require_once('./send/class.phpmailer.php');
    //include("class.smtp.php"); // optional, gets called from within class.phpmailer.php if not already loaded

    $mail = new PHPMailer(true); //defaults to using php "mail()"; the true param means it will throw exceptions on errors, which we need to catch

    // $body                = file_get_contents('contents.html');

    $body = 'Dear Test this is a test.';

    // $body = preg_replace('/\\\\/i', $body);

    $mail->SetFrom('crea@cruiseit.co.uk', 'List manager');
    $mail->AddReplyTo('crea@cruiseit.co.uk', 'List manager');

    $mail->Subject       = "Mailing List Test Weekly";

    $gasoil_every_mon_users = mysql_query("SELECT leadname , email FROM hqfjt_chronoforms_data_addupdatelead WHERE receivegasoilmailinglist = 'everymonday'") or die(mysql_error());
    $result3 = @MYSQL_QUERY($gasoil_every_mon_users);

    while ($row = mysql_fetch_array ($result3)) {
      $mail->AltBody    = "To view the message, please use an HTML compatible email viewer!"; // optional, comment out and test
      $mail->MsgHTML($body);
      $mail->AddAddress($row["email"], $row["leadname"]);
      $mail->AddStringAttachment($row["photo"], "YourPhoto.jpg");

      if(!$mail->Send()) {
        echo "Mailer Error (" . str_replace("@", "&#64;", $row["email"]) . ') ' . $mail->ErrorInfo . '<br>';
      } else {
        echo "Message sent to :" . $row["full_name"] . ' (' . str_replace("@", "&#64;", $row["email"]) . ')<br>';
      }
      // Clear all addresses and attachments for next loop
      $mail->ClearAddresses();
      $mail->ClearAttachments();
    }
    };
    //end of GAS OIL WEEKLY emailer
    ?>    

    <?php
    // START OF DERV WEEKLY EMAILER
    function dervweeklyemailer(){
    require_once('./send/class.phpmailer.php');
    //include("class.smtp.php"); // optional, gets called from within class.phpmailer.php if not already loaded

    $mail = new PHPMailer(true); //defaults to using php "mail()"; the true param means it will throw exceptions on errors, which we need to catch

    // $body                = file_get_contents('contents.html');

    $body = 'Dear Test this is a test.';

    // $body = preg_replace('/\\\\/i', $body);

    $mail->SetFrom('crea@cruiseit.co.uk', 'List manager');
    $mail->AddReplyTo('crea@cruiseit.co.uk', 'List manager');

    $mail->Subject       = "Mailing List Test Weekly";

    $derv_every_mon_users = mysql_query("SELECT leadname , email FROM hqfjt_chronoforms_data_addupdatelead WHERE receivedervmailinglist = 'everymonday'") or die(mysql_error());
    $result4 = @MYSQL_QUERY($derv_every_mon_users);

    while ($row = mysql_fetch_array ($result4)) {
      $mail->AltBody    = "To view the message, please use an HTML compatible email viewer!"; // optional, comment out and test
      $mail->MsgHTML($body);
      $mail->AddAddress($row["email"], $row["leadname"]);
      $mail->AddStringAttachment($row["photo"], "YourPhoto.jpg");

      if(!$mail->Send()) {
        echo "Mailer Error (" . str_replace("@", "&#64;", $row["email"]) . ') ' . $mail->ErrorInfo . '<br>';
      } else {
        echo "Message sent to :" . $row["full_name"] . ' (' . str_replace("@", "&#64;", $row["email"]) . ')<br>';
      }
      // Clear all addresses and attachments for next loop
      $mail->ClearAddresses();
      $mail->ClearAttachments();
    }
    };
    // END OF DERV WEEKLY EMAILER
    ?>    

    <?php
    // START OF KERO WEEKLY EMAILER
    function keroweeklyemailer(){
    require_once('./send/class.phpmailer.php');
    //include("class.smtp.php"); // optional, gets called from within class.phpmailer.php if not already loaded

    $mail = new PHPMailer(true); //defaults to using php "mail()"; the true param means it will throw exceptions on errors, which we need to catch

    // $body                = file_get_contents('contents.html');

    $body = 'Dear Test this is a test.';

    // $body = preg_replace('/\\\\/i', $body);

    $mail->SetFrom('crea@cruiseit.co.uk', 'List manager');
    $mail->AddReplyTo('crea@cruiseit.co.uk', 'List manager');

    $mail->Subject       = "Mailing List Test Weekly";

    $kero_every_mon_users = mysql_query("SELECT leadname , email FROM hqfjt_chronoforms_data_addupdatelead WHERE receivekeromailinglist = 'everymonday'") or die(mysql_error());
    $result5 = @MYSQL_QUERY($kero_every_mon_users);

    while ($row = mysql_fetch_array ($result5)) {
      $mail->AltBody    = "To view the message, please use an HTML compatible email viewer!"; // optional, comment out and test
      $mail->MsgHTML($body);
      $mail->AddAddress($row["email"], $row["leadname"]);
      $mail->AddStringAttachment($row["photo"], "YourPhoto.jpg");

      if(!$mail->Send()) {
        echo "Mailer Error (" . str_replace("@", "&#64;", $row["email"]) . ') ' . $mail->ErrorInfo . '<br>';
      } else {
        echo "Message sent to :" . $row["full_name"] . ' (' . str_replace("@", "&#64;", $row["email"]) . ')<br>';
      }
      // Clear all addresses and attachments for next loop
      $mail->ClearAddresses();
      $mail->ClearAttachments();
    }
    };
    // END OF KERO WEEKLY EMAILER
    ?>    



    <?php
    // START OF GAS OIL MONTHLY EMAILER
    function gasoilmonthlyemailer(){
    require_once('./send/class.phpmailer.php');
    //include("class.smtp.php"); // optional, gets called from within class.phpmailer.php if not already loaded

    $mail = new PHPMailer(true); //defaults to using php "mail()"; the true param means it will throw exceptions on errors, which we need to catch

    // $body                = file_get_contents('contents.html');

    $body = 'Dear Test this is a test.';

    // $body = preg_replace('/\\\\/i', $body);

    $mail->SetFrom('crea@cruiseit.co.uk', 'List manager');
    $mail->AddReplyTo('crea@cruiseit.co.uk', 'List manager');

    $mail->Subject       = "Mailing List Test monthly";

    $gasoil_1st_mon_users = mysql_query("SELECT leadname , email FROM hqfjt_chronoforms_data_addupdatelead WHERE receivegasoilmailinglist = 'firstmondayofthemonth'") or die(mysql_error());
    $result6 = @MYSQL_QUERY($gasoil_1st_mon_users);

    while ($row = mysql_fetch_array ($result6)) {
      $mail->AltBody    = "To view the message, please use an HTML compatible email viewer!"; // optional, comment out and test
      $mail->MsgHTML($body);
      $mail->AddAddress($row["email"], $row["leadname"]);
      $mail->AddStringAttachment($row["photo"], "YourPhoto.jpg");

      if(!$mail->Send()) {
        echo "Mailer Error (" . str_replace("@", "&#64;", $row["email"]) . ') ' . $mail->ErrorInfo . '<br>';
      } else {
        echo "Message sent to :" . $row["full_name"] . ' (' . str_replace("@", "&#64;", $row["email"]) . ')<br>';
      }
      // Clear all addresses and attachments for next loop
      $mail->ClearAddresses();
      $mail->ClearAttachments();
    }
    };
    // END OF GAS OIL MONTHLY EMAILER
    ?>    

    <?php
    //START OF DERV MONTHLY EMAILER
    function dervmonthlyemailer(){
    require_once('./send/class.phpmailer.php');
    //include("class.smtp.php"); // optional, gets called from within class.phpmailer.php if not already loaded

    $mail = new PHPMailer(true); //defaults to using php "mail()"; the true param means it will throw exceptions on errors, which we need to catch

    // $body                = file_get_contents('contents.html');

    $body = 'Dear Test this is a test.';

    // $body = preg_replace('/\\\\/i', $body);

    $mail->SetFrom('crea@cruiseit.co.uk', 'List manager');
    $mail->AddReplyTo('crea@cruiseit.co.uk', 'List manager');

    $mail->Subject       = "Mailing List Test monthly";

    $derv_1st_mon_users = mysql_query("SELECT leadname , email FROM hqfjt_chronoforms_data_addupdatelead WHERE receivedervmailinglist = 'firstmondayofthemonth'") or die(mysql_error());
    $result7 = @MYSQL_QUERY($derv_1st_mon_users);

    while ($row = mysql_fetch_array ($result7)) {
      $mail->AltBody    = "To view the message, please use an HTML compatible email viewer!"; // optional, comment out and test
      $mail->MsgHTML($body);
      $mail->AddAddress($row["email"], $row["leadname"]);
      $mail->AddStringAttachment($row["photo"], "YourPhoto.jpg");

      if(!$mail->Send()) {
        echo "Mailer Error (" . str_replace("@", "&#64;", $row["email"]) . ') ' . $mail->ErrorInfo . '<br>';
      } else {
        echo "Message sent to :" . $row["full_name"] . ' (' . str_replace("@", "&#64;", $row["email"]) . ')<br>';
      }
      // Clear all addresses and attachments for next loop
      $mail->ClearAddresses();
      $mail->ClearAttachments();
    }
    };
    //END OF DERV MONTHLY EMAILER
    ?>    

    <?php
    // START OF KERO MONTHLY EMAILER
    function keromonthlyemailer(){
    require_once('./send/class.phpmailer.php');
    //include("class.smtp.php"); // optional, gets called from within class.phpmailer.php if not already loaded

    $mail = new PHPMailer(true); //defaults to using php "mail()"; the true param means it will throw exceptions on errors, which we need to catch

    // $body                = file_get_contents('contents.html');

    $body = 'Dear Test this is a test.';

    // $body = preg_replace('/\\\\/i', $body);

    $mail->SetFrom('crea@cruiseit.co.uk', 'List manager');
    $mail->AddReplyTo('crea@cruiseit.co.uk', 'List manager');

    $mail->Subject       = "Mailing List Test monthly";

    $kero_1st_mon_users = mysql_query("SELECT leadname , email FROM hqfjt_chronoforms_data_addupdatelead WHERE receivekeromailinglist = 'firstmondayofthemonth'") or die(mysql_error());
    $result8 = @MYSQL_QUERY($kero_1st_mon_users);

    while ($row = mysql_fetch_array ($result8)) {
      $mail->AltBody    = "To view the message, please use an HTML compatible email viewer!"; // optional, comment out and test
      $mail->MsgHTML($body);
      $mail->AddAddress($row["email"], $row["leadname"]);
      $mail->AddStringAttachment($row["photo"], "YourPhoto.jpg");

      if(!$mail->Send()) {
        echo "Mailer Error (" . str_replace("@", "&#64;", $row["email"]) . ') ' . $mail->ErrorInfo . '<br>';
      } else {
        echo "Message sent to :" . $row["full_name"] . ' (' . str_replace("@", "&#64;", $row["email"]) . ')<br>';
      }
      // Clear all addresses and attachments for next loop
      $mail->ClearAddresses();
      $mail->ClearAttachments();
    }
    };
    //END OF KERO MONTHLY EMAILER
    ?>    
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-28T00:40:48+00:00Added an answer on May 28, 2026 at 12:40 am

    You are mysql_querying a mysql_query

    $gasoil_daily_users = mysql_query("SELECT leadname , email FROM hqfjt_chronoforms_data_addupdatelead WHERE receivegasoilmailinglist = 'everyday'") or die(mysql_error());
    $result = @MYSQL_QUERY($gasoil_daily_users);
    

    If you remove the second line, or change $gasoil_daily_users to your query string:

    $gasoil_daily_users = "SELECT leadname , email FROM hqfjt_chronoforms_data_addupdatelead WHERE receivegasoilmailinglist = 'everyday'";
    $result = mysql_query($gasoil_daily_users) or die(mysql_error());
    

    Your code should work fine.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm having some problems with the php script below that I'm currently working on.
I'm having some rather unusual problems using grep in a bash script. Below is
I have two problems in my current .htaccess. The script below works but has
I have a bash script to upload some files to my webserver. The problem
I have some problems with Miktex installed on Windows Vista Business SP1/32 bit. I
I have some problems on a site with the concurrent access to a list.
I have some problems sending mails through SMTP using Spring's MailSender interface and the
I have some problems with OpenCV s cvCanny(...) and the Image data types it
i have some problems with rowspan: var doc1 = new Document(); doc1.SetPageSize(PageSize.A4.Rotate()); string path
I have some problems sending an id though jquery. I have a form select

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.