While i was working in my PC (local) everything works fine but when i uploaded my project to a server all the querys doesn´t work and i don´t know why.
I use querys like this one:
header('Content-Type: text/html; charset=UTF-8');
include_once '../includes/db_connect.php';
include_once '../includes/psl-config.php';
$mysqli->query("SET NAMES 'utf8'");
$fechaRecibo = mysql_real_escape_string( $_POST["fechaRecibo"] );
$nombre = mysql_real_escape_string( $_POST["nombre"] );
$recibiDe = mysql_real_escape_string( $_POST["recibiDe"] );
$monto = mysql_real_escape_string( $_POST["monto"] );
$comentario = mysql_real_escape_string( $_POST["comentario"] );
$idUser = mysql_real_escape_string( $_POST['idUser'] );
$sql = "INSERT INTO vales (fecha, nombre, recibiDe, monto, comentario, created_by) values ('$fechaRecibo','$nombre','$recibiDe','$monto','$comentario','$idUser')";
$res = $mysqli->query($sql);
$lastID = mysqli_insert_id($mysqli);
if ($res){
echo "Éxito"
}
else{
printf("Error message: %s\n", $mysqli->error);
}
And it shows "Error message" on the screen, but it does not say which one is the error. It seems that $mysqli->error doesn´t work. What i don´t understand why working in a local way it works and in a server it does't.