0

The second value 4 is insert

$time= time() + (1 * 24*60*60);
$rr = date('Y-M-d' , $time);
        
$sql = "INSERT INTO time_on_screen(wakeup, sleep) VALUES ( '$rr' ,4)";
mysqli_query($conn,$sql);  
Dominik
  • 6,078
  • 8
  • 37
  • 61
Yossef Yossef
  • 111
  • 1
  • 2
  • 9

1 Answers1

0

Depending on your locale, '$rr' is something like '2020-Sep-30', and that is not a valid MySql date. You need '2020-09-30'.

Try:

$rr = date('Y-m-d' , $time); // M -> m
Booboo
  • 38,656
  • 3
  • 37
  • 60