title: I Can Never Execute SQL-Safe Queries?
body: <p>I am using the ODBC extension in PHP to connect to an SQL 2000 server. Here is what I am up against:</p>
  
  <ol>
  <li>I can execute queries with <code>odbc_exec()</code> OR</li>
  <li>I can execute queries with <code>odbc_execute()</code></li>
  </ol>
  
  <p>In my opinion, the differences between these two query executing methods are nearly as different as night and day:</p>
  
  <ol>
  <li><code>odbc_exec()</code> will execute a non SQL-safe query and return the results from the query</li>
  <li><code>odbc_execute()</code> is used in conjunction with <code>odbc_prepare()</code> to execute an SQL safe query on the database. However, <code>odbc_execute()</code> can only ever return a boolean, and therefore cannot be used to return the results from a <code>SELECT</code> statement, or to check how many rows were updated from an <code>UPDATE</code> or <code>DELETE</code> statement</li>
  </ol>
  
  <p>Is this really the way this all works, or is there some way to escape values for use in <code>odbc_exec()</code> or to get the results back from <code>odbc_execute()</code>?</p>
  
  <p>The PHP documentation doesn't seem to over any solutions for the above dilemma.</p>
  
  <p>Thank you for your time.</p>