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
  • 5,682
  • 7
  • 37
  • 55
Yossef Yossef
  • 81
  • 1
  • 7

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
  • 29,245
  • 3
  • 32
  • 48