The problem is with bind_param where there's no value. According to the documentation ( https://www.php.net/manual/es/mysqli-stmt.bind-param.php )bind_param(string $types, mixed &$var1, mixed &$... = ?): bool
Since the first parameter is a list of coded types as a string, perhaps you found this as a parameter of the query, but in fact there are 23 values only, missing the last corresponding to id_prop. The call should remain like:$up->bind_param(
"ssssiiisssssssdssssssssi", // agregar i al final si id_prop es entero
$ref,
$operacion,
$tipo_inmueble,
$estado_inmueble,
$dormitorios,
$banos,
$mts,
$provincia,
$municipio,
$codigoPostal,
$direccion,
$latitud,
$longitud,
$zona,
$precio,
$tituloComentario,
$comentario_web,
$estatus,
$asesor,
$vendedor,
$tel,
$correo,
$mapa,
$id_prop // debe obtenerse de algun lado
);
EDIT: About the eval() There is another alternative better to create your own input value array:$data = [];
foreach ($_POST as $campo => $valor) {
$data[$campo] = $valor; // no es necesario escapar comillas, pero puedes aqui realizar cualquier post-proceso o sanitizacion
// echo $data[$campo];
// echo '<br>';
}
And then use the values $data in the call directly (you can even use $_POST if you do not require additional filtering/sanitation)$up->bind_param(
"ssssiiisssssssdssssssss",
$data['ref'],
$data['operacion'],
$data['tipo_inmueble'],
$data['estado_inmueble'],
$data['dormitorios'],
$data['banos'],
$data['mts'],
$data['provincia'],
...