<pre><?php if (isset($_POST['ingresarsim'])) { $ingresarSim = trim($_POST['ingresarsim']); } $conexv = mysqli_connect("localhost","root","") or die("problemas al conectar"); mysqli_select_db($conexv,"ventas") or die("problemas base de datos"); $reg = mysqli_prepare($conexv, "SELECT COUNT(*) FROM ventas WHERE id = ?"); mysqli_stmt_bind_param($reg, "i", $ingresarSim); mysqli_stmt_execute($reg); $conteoFilas = mysqli_stmt_get_result($reg); if (!$reg) { print_r(mysqli_error($conexv)); } else { if ($conteoFilas->field_count > 0) { $eliminado = mysqli_query($conexv, "DELETE FROM sim WHERE id = ?")or die ("Problemas en consulta:". mysqli_error($conexv)); ; mysqli_stmt_bind_param($eliminado, "i", $ingresarSim); mysqli_stmt_execute($eliminado); echo "Datos Eliminados"; } else { echo "Datos no han sido Eliminados"; } } ?>
I have tried a lot of advice online but couldnt resolve this error.
$ingresarSim
mysqli_stmt_bind_param
mysqli_query
mysqli_prepare
$eliminado = mysqli_query
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)