Prevent oversized log message when there is no error.

Mon, 03 May 2021 08:41:18 +0200

author
Michiel Broek <mbroek@mbse.eu>
date
Mon, 03 May 2021 08:41:18 +0200
changeset 742
3c8928d956cd
parent 741
4ec5de404bc1
child 743
7a4adede7d3f

Prevent oversized log message when there is no error.

www/prod_duplicate.php file | annotate | diff | comparison | revisions
--- a/www/prod_duplicate.php	Sun May 02 22:13:30 2021 +0200
+++ b/www/prod_duplicate.php	Mon May 03 08:41:18 2021 +0200
@@ -214,11 +214,11 @@
 $sql .= "', json_yeasts='" . str_replace($rescapers,$rreplacements,$row['json_yeasts']);
 $sql .= "', json_mashs='" . str_replace($rescapers,$rreplacements,$row['json_mashs']);
 $sql .= "';";
-syslog(LOG_NOTICE, $sql);
 
 $result = mysqli_query($link, $sql);
 if (! $result) {
 	syslog(LOG_NOTICE, "db_product: result: ".mysqli_error($link));
+	syslog(LOG_NOTICE, $sql);
 } else {
 	$lastid = mysqli_insert_id($link);
 	syslog(LOG_NOTICE, "db_product: inserted record ".$lastid);

mercurial