CONTEXT:
Will add manualy a record after the login_ok, After the partial success and total failure I GET ERROR500, the insert works nice in phpadmin and also using the wrong func it ADDS a record but the right func does noting at all. Code Bellow:
function login_ok($memberInfo, &$args) {
///This sends an email it works nicely
$timeTasks=sqlValue("SELECT SUM(minuesti) FROM tareas WHERE tareas.cip='1' AND tareas.estado='Activo' AND DATE(tareas.fechaini) = CURDATE()");
mail(
'aalain@???.com',
'Entrada al sistema exitosa, dentro veras los segundos pendientes' ,
'Tienes un total de: ' . $timeTasks . ' segundos pendientes.' ,
"From: tachasserver@???\r\n"
);
///This works adding the record (I know this is not the right func but at least it adds the record, then breaks
$anade=sqlValue("INSERT INTO tareas (detalle, fechaini, fechafinal, cip, estado, minuesti, tipo) VALUES ('macarron', '$fecha_actual', '$fecha_actual', 1, 'Activo', 88, 'Recu')");
///This is supposed to be the right func, it just breaks the system
sql("INSERT INTO tareas (detalle, fechaini, fechafinal, cip, estado, minuesti, tipo) VALUES ('macarron', '$fecha_actual', '$fecha_actual', 1, 'Activo', 99, 'Recu')");
return '';
}
The right func breake it, other func also but at least it works
-
- Veteran Member
- Posts: 104
- Joined: 2018-12-10 21:52
Re: The right func breake it, other func also but at least it works
Hi try
Actually the Same applies for the sql function call
Code: Select all
$eo=Array();
$anade=sqlValue("INSERT INTO tareas (detalle, fechaini, fechafinal, cip, estado, minuesti, tipo) VALUES ('macarron', '$fecha_actual', '$fecha_actual', 1, 'Activo', 88, 'Recu'),$eo");
Any help offered comes with the best of intentions. Use it at your own risk. In any case, please make a backup of your existing environment before applying any changes.
-
- Veteran Member
- Posts: 104
- Joined: 2018-12-10 21:52
Re: The right func breake it, other func also but at least it works
Hi, thanks for the help this is the status (failed) here is what I did
01 Sanitized the sql statement so it adds nulls just for minimize any dumb error
02 Tested running and works but BREAKS it
$anade=sqlValue("INSERT INTO tareas (cip, nomb1, ape1, detalle, fechaini, comentario, fechafinal, estado, minuesti, tipo) VALUES (1, NULL, NULL, 'gettinghelp','$fecha_actual', NULL, '$fecha_actual', 'Activo', 77, 'Recu')");
03 Added the sugested adjustments and it doesnt breake it, but it doesnt add anything to the DB either:
$eo=Array();
$anade=sqlValue("INSERT INTO tareas (cip, nomb1, ape1, detalle, fechaini, comentario, fechafinal, estado, minuesti, tipo) VALUES (1, NULL, NULL, 'gettinghelp','$fecha_actual', NULL, '$fecha_actual', 'Activo', 77, 'Recu'),$eo");
I think Im doing something wrong
Any comment?
a3
01 Sanitized the sql statement so it adds nulls just for minimize any dumb error
02 Tested running and works but BREAKS it
$anade=sqlValue("INSERT INTO tareas (cip, nomb1, ape1, detalle, fechaini, comentario, fechafinal, estado, minuesti, tipo) VALUES (1, NULL, NULL, 'gettinghelp','$fecha_actual', NULL, '$fecha_actual', 'Activo', 77, 'Recu')");
03 Added the sugested adjustments and it doesnt breake it, but it doesnt add anything to the DB either:
$eo=Array();
$anade=sqlValue("INSERT INTO tareas (cip, nomb1, ape1, detalle, fechaini, comentario, fechafinal, estado, minuesti, tipo) VALUES (1, NULL, NULL, 'gettinghelp','$fecha_actual', NULL, '$fecha_actual', 'Activo', 77, 'Recu'),$eo");
I think Im doing something wrong
Any comment?
a3
Re: The right func breake it, other func also but at least it works
Just a hint:
I've seen that data-mofifying SQL commands like INSERT, UPDATE, DELETE may not work with
For those try
That's just what I've noticed when migrating projects to PHP 8.x.
I've seen that data-mofifying SQL commands like INSERT, UPDATE, DELETE may not work with
sqlValue-function
.For those try
sql("YOUR SQL COMMAND", $eo)
instead of sqlValue("...", $eo)
.That's just what I've noticed when migrating projects to PHP 8.x.
Kind regards,
<js />
My AppGini Blog:
https://appgini.bizzworxx.de/blog
You can help us helping you:
Please always put code fragments inside
AppGini 24.10 Revision 1579 + all AppGini Helper tools
<js />
My AppGini Blog:
https://appgini.bizzworxx.de/blog
You can help us helping you:
Please always put code fragments inside
[code]...[/code]
blocks for better readabilityAppGini 24.10 Revision 1579 + all AppGini Helper tools
-
- Veteran Member
- Posts: 104
- Joined: 2018-12-10 21:52
Re: The right func breake it, other func also but at least it works
Thanks! Im gonna try that ASAP
aw
aw