Chatter of the day

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    #16
    Yes bro it kind of works lol this is the result it gives
    Debug: timestamp: 1516214785 dbDay: 17 Day: 17
    the 1516..... is exactly the lowest number in the table but the only problem is that i need a code to show that if the 24 hours has passed then send the message to the members

    Comment


      #17
      I'm guessing this should work bro what you think
      $day = date('d');
      $timestamp = mysql_fetch_array(mysql_query("SELECT MIN(timesent) FROM ibwf_updateday"));
      $dbDate = date('d', $timestamp[0]);
      if($dbDate!=$day)
      {

      Comment


        #18
        Putting the date in a string is the same as having it in the "if" statement.
        I have no idea why that bit of code is failing for you.... I just tested it and it works perfectly for me.

        It shouldn't run again and keep repeating sending private messages unless the delete is not working correctly.

        Comment


          #19
          Your time calculation is round the wrong way try this instead:
          Code:
          $workout = time() - 86400 + 120;  
          mysql_query("DELETE FROM ibwf_updateday WHERE timesent<'".$workout."'");

          Comment


            #20
            Thanks bro the delete query is working better now thanks to you, but the messages keeps coming still one after the other
            when it is like this if($dbDate=$day), but when i add the exclamation mark which means 'not' i guess if($dbDate!=$day) it stops just hope when the server time reaches it will send the message, and i believe if the message comes rapidly, then it may be wise for me to just do
            $workout = time() - 86400 + 2; mysql_query("DELETE FROM ibwf_updateday WHERE timesent<'".$workout."'"); so exactly after one message is sent to the respective members, it will clear the table in 2 seconds. Makes sense to you?

            Comment


              #21
              Yeah the exclamation is there on my original post, so guessing it got lost in copy and pasting

              Comment


                #22
                something else it worked fine on the timings in sending the message the right time at the end of the day according to the server time bro..you're a damn genius!!! thanks alot :D :D

                Comment


                  #23
                  Your welcome :D

                  Comment

                  Working...
                  X