Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

creating bak record in database causing fatal error #2

Open
Jimmi08 opened this issue Aug 17, 2021 · 0 comments
Open

creating bak record in database causing fatal error #2

Jimmi08 opened this issue Aug 17, 2021 · 0 comments

Comments

@Jimmi08
Copy link

Jimmi08 commented Aug 17, 2021

Because this:

					if($sql->select('logstats','log_id',"log_id='".$datestamp."' ") && !$sql->select('logstats','log_id',"log_id='bak-".$datestamp."' "))
					{
						$sql->update('logstats', "log_id='bak-".$datestamp."' WHERE log_id='".$datestamp."' ");
					}

Double data are created:
image

And this is causing fatal error:

Fatal error: Uncaught TypeError: mktime(): Argument #6 ($year) must be of type ?int, string given in ***\e107_plugins\log\stats.php:1821 Stack trace: #0 ***\e107_plugins\log\stats.php(1821): mktime(0, 0, 0, '2021', '08', 'bak') #1 ***\e107_plugins\log\stats.php(212): siteStats->renderDaily() #2 ***\index.php(69): include_once('C:\\xampp8.0\\htd...') #3 {main} thrown in ***\e107_plugins\log\stats.php on line 1821

because explode fails on text "bak":

list($year, $month, $day) = explode("-", $date);
$date = strftime ("%A, %B %d", mktime (0,0,0,$month,$day,$year));
2021-08-17
08
17
2021

bak-2021-08-17
2021
08
bak
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant