title: Executing SQL directly; no cursor., SQL state 01000 in SQLExecDirect
body: <p>Im using WAMP sever PHP 5.3.4 and sql server 2008 r2 connect using the driver odbc driver 2011
  When i execute this query i got the correct answer, <br><br></p>
  
  <pre><code>SELECT [password],[username] FROM [customer]
  </code></pre>
  
  <p>But having an error While execute the below query,i checked the same query in the sqlserver it gave me the result corrcetly <br><br></p>
  
  <pre><code>SELECT [password],[username] FROM customer Where $name=[password] and $pass=[username]
  </code></pre>
  
  <p>This is what the error im getting</p>
  
  <blockquote>
    <p>A PHP Error was encountered</p>
    
    <p>Severity: Warning</p>
    
    <p>Message: odbc_exec(): SQL error: [Microsoft][ODBC Driver 11 for SQL
    Server][SQL Server]Executing SQL directly; no cursor., SQL state 01000
    in SQLExecDirect</p>
    
    <p>Filename: models/general_account.php</p>
    
    <p>Line Number: 18</p>
  </blockquote>
  
  <p><strong>UPDATE:</strong></p>
  
  <pre><code>function login($name,$pass)
  {
  var_dump($name);
  var_dump($pass);        
  $this-&gt;load-&gt;database();
  $conn=odbc_connect('odbcconnection','sa','sa') or die ('error');
  $sql='SELECT [password],[username] FROM customer Where $name=[password] and $pass=[username]';          
  $rs=odbc_exec($conn,$sql) or die('exe error');            
  odbc_close($conn); 
  }    
  </code></pre>
  
  <p>Thanks in Advance.</p>