Hello,

I'm getting 26 errors:

Warning: mktime() expects parameter 6 to be long, string given in /data/17/1/75/92/1727255/user/1864921/htdocs/manage_schedule.php on line ...

Refered to 6 diferent lines.

The mktime() is performed whe modifiying some schedule data, and this is what I see in the code (twice):

$x=date("H:i",mktime(1,15*$i,0,date("m"),date("d"),date("Y")));

The error is showed when coming back to the schedule.

Hope it makes sense for you 😛

I'd like to know what must be in the 6 parameter, and how to note it.

Note: I'm a re-newby. 3 years without scripting in PHP, so be patience, please.

Cheers.

Sergio

    That line is fine, it must be one of the others (the one on the line cited in the error message): whatever it's getting for the year is bogus.

    But on the line you show, the last three arguments are unnecessary because they all default to the current time if not given explicitly. mktime(1, 15*$i, 0) would do the job just as well.

      So, the problem must be in the code that is reading the result? That's what you say?

      I think you are right, the errors appears when coming back to the page that use the data generated by the script above.

      Thanks for the tip about the redundance.

      Let me try to find where is the error.

        sergiox wrote:

        Let me try to find where is the error.

        But you don't need to find anything; PHP is giving you the exact line number where it's encountering a problem with mktime().

          🙂 Hi bradgrafelman. Yes, I need to find it.

          The lines are:

          457 {
          ...
          ...
          499 {
          ...
          ...
          592 $totalid=array();
          ...
          ...
          613 }
          614 $dayt1k=implode(',',$fogk);
          615 $total='';$shidk='';$totalh='';$shbr='';
          616 $sql_shiftk=executeQuery("select *,count(tbl_shift_schedule.id) as cnt from tbl_shift inner join tbl_shift_schedule on(tbl_shift.id=tbl_shift_schedule.shift_id) where tbl_shift_schedule.day in ($dayt1k) and tbl_shift_schedule.schedule_id='$schedule' and tbl_shift_schedule.shift_id='$shift' and tbl_shift_schedule.company_id='".$li['id']."' and tbl_shift_schedule.status=1 group by tbl_shift_schedule.day");

          The code, in general, is defining the data to be displayed. Seems that in the first lines showed as errors, is not the "}" what's wrong, but the line behind, or the next one. I'm right?

          Thanks.

            Hi Weedpacket,

            I've changed to mktime(1, 15*$i, 0), just for testing, but it's obvious that the bug is in other place. I hate inheritances, but I really want to help the owner of the site to solve this issue.

            Let me know: It's supposed that the errors are near of the lines showed (as bradgrafelman says), but it's possible that the errors are produced before, in the file that has the mktime() functions?

            I mean, when executed the code of the file, could be reading a wrong parameter generated by other one, in other file. For me that sounds logic. Tell me if I'm wrong.

            Thanks

              See, now none of those lines mention mktime() at all, so none of them would result in the error message you describe.

                I didn't describe the errors. I did copy and paste them. Those errors are saying "Warning: mktime() expects parameter 6 to be long...", and are pointing to the lines described. So: (?)

                Those lines have nothing to do with mktime()?

                Well...

                Thanks.

                  Write a Reply...