I have a code in php and mysql to edit a ticket but when I edit it with the new values it tells me the message as if it had been inserted but it does not enter the database
the ajax code to edit
<?php
include('is_logged.php');
if (empty($_POST['mod_incidencia'])) {
$errors[] = "incidencia vacío";
}else if (empty($_POST['mod_detalle'])) {
$errors[] = "detalle vacío";
}else if (empty($_POST['mod_tema'])) {
$errors[] = "tema vacío";
} else if (
!empty($_POST['mod_tema']) &&
!empty($_POST['mod_detalle']) &&
!empty($_POST['mod_incidencia'])
){
require_once ("../config/db.php");
require_once ("../config/conexion.php");
$incidencia=mysqli_real_escape_string($con,(strip_tags($_POST["mod_incidencia"],ENT_QUOTES)));
$tema=mysqli_real_escape_string($con,(strip_tags($_POST["mod_tema"],ENT_QUOTES)));
$detalle=mysqli_real_escape_string($con,(strip_tags($_POST["mod_detalle"],ENT_QUOTES)));
$Nticket=intval($_POST['mod_Nticket']);
$sql="UPDATE ticket SET incidencia='".$incidencia."', tema='".$tema."',
detalle='".$detalle."' WHERE Nticket='".$Nticket."'";
$query_update = mysqli_query($con,$sql);
if ($query_update){
$messages[] = "Ticket ha sido actualizado satisfactoriamente.";
//me aparece este mensaje cuando ingreso pero no se actualiza en la BD\
} else{
$errors []= "Lo siento algo ha salido mal intenta nuevamente.".mysqli_error($con);
}
} else {
$errors []= "Error desconocido.";
}
if (isset($errors)){
?>
<div class="alert alert-danger" role="alert">
<button type="button" class="close" data-dismiss="alert">×</button>
<strong>Error!</strong>
<?php
foreach ($errors as $error) {
echo $error;
}
?>
</div>
<?php
}
if (isset($messages)){
?>
<div class="alert alert-success" role="alert">
<button type="button" class="close" data-dismiss="alert">×</button>
<strong>¡Bien hecho!</strong>
<?php
foreach ($messages as $message) {
echo $message;
}
?>
</div>
<?php
}
?>