title: SQL state 37000 in SQLExecDirect
body: <p>here is my error`</p>
  
  <blockquote>
    <p><b>Warning</b>:  odbc_exec(): SQL error: [Microsoft][ODBC SQL Server Driver][SQL Server]Sintaxis incorrecta cerca de '123'., SQL state 37000 in SQLExecDirect in <b>C:\xampp\htdocs\Estadias\api\MODELS\connection_sql_server.php</b> on line <b>19</b><br />
    Error [Microsoft][ODBC SQL Server Driver][SQL Server]Sintaxis incorrecta cerca de '123'.</p>
  </blockquote>
  
  <p>the query:</p>
  
  <pre><code> select todos.matricula,u.constrasenia, todos.nombres,todos.paterno,t.id ,t.description 
  from usuarios u join typeofuser t on u.tipo = t.id 
  join (select matricula,nombres, paterno from Alumnos union select id as 
  id, numbres, paterno from tutores union select id as id, nombre, paterno   
  from asesor_empresarial) todos on todos.matricula = u.id where u.id = 
  '12312' and u.constrasenia = '123'; 
  </code></pre>
  
  <p>here my code.</p>
  
  <pre><code>$user= $_POST['usr_id'];
  $pswd=$_POST['usr_psw'];
  if (isset($user) &amp;&amp; isset($pswd))
  {
  
  $connection = new SqlServerConnection();
  try
  {
      $query = sprintf('select todos.matricula,u.constrasenia,           
      todos.nombres,todos.paterno,t.id ,t.description from usuarios u 
      join typeofuser t on u.tipo = t.id join (select matricula,nombres,
      paterno from Alumnos union select id as id, numbres, paterno 
      from tutores union select id as id, nombre, paterno 
      from asesor_empresarial) todos on todos.matricula = u.id where u.id =
      \''.$user.'\' and u.constrasenia = \''.$pswd."';");
  
      echo $query;
  
      $data=$connection-&gt;execute_query($query);
  
      odbc_result($data, 'matricula');
      odbc_result($data, 'constrasenia');
      odbc_result($data, 'nombres');
      odbc_result($data, 'paterno');
      odbc_result($data, 'id');
      odbc_result($data, 'description');
  
      if (odbc_result($data, 'matricula')=='' &amp;&amp; odbc_result($data, 'constrasenia')=='') {
  
              echo $result='{"status" : 1 , "Descrition" : "User Not Found" }';
                      die;
      }
      $u = new User(odbc_result($data, 'id'),odbc_result($data, 'constrasenia'));
      echo '
          { "status" : "0" ,
               "User":
               {
                  "userID" : "'.$u-&gt;get_id().'",
                  "nombre" : "'.$nombre.'",
                  "paterno" : "'.$paterno.'",
                  "imagen" : "'.$img.'",
                  "UserType" : 
                                  {
                                      "ID" : "'.$u-&gt;get_user_type()-&gt;get_id_type().'",
                                      "Description" : "'.$u-&gt;get_user_type()-&gt;get_description().'"
                                  },
                  "token" : "'.generate_token($user).'"                   
               } 
          }';
  }
  finally
  {
      $connection-&gt;close();
  }
  </code></pre>