title: Execute a $mysqli->query($sql)
body: <p>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. </p>
  
  <p>I use querys like this one: </p>
  
  <pre><code>header('Content-Type: text/html; charset=UTF-8');
  include_once '../includes/db_connect.php';
  include_once '../includes/psl-config.php';
  $mysqli-&gt;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-&gt;query($sql);
  $lastID = mysqli_insert_id($mysqli);
  if ($res){
       echo "Éxito"
  } 
  else{
      printf("Error message: %s\n", $mysqli-&gt;error);
  }
  </code></pre>
  
  <p>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. </p>