title: connecting to quickbooks database via odbc with php?
body: <p><b>[edit]</b><br />
  We're collecting credit application data from users on a web form.</p>
  
  <p>I have not tied my web form directly into QB.</p>
  
  <p>I have no idea what the QB table structure is for this collection of data - nor of how it displays it to the user because I've never actually worked directly with QB.  Others in my office do however.</p>
  
  <hr>
  
  <p>I would still appreciate any information about open source / free options.</p>
  
  <hr>
  
  <p>I'll simplify the problem by removing the first desired option.</p>
  
  <p>Let's just talk about importing a flat file into quickbooks.</p>
  
  <p>I don't have a copy of quickbooks that I can play with, so I have no idea what options exist that are native to quickbooks but I see some chatter on the web about QB expecting an .ini file for imports.  (don't know the format that it expects yet, but I'll get that worked out later)</p>
  
  <p>Please share your story if you have managed to import a flat file from mySQL into quickbooks or know of links that offer insight (I'm not finding much right now).<br />
  <b>[end edit]</b></p>
  
  <p>I realize that this scenario is probably uncommon, but I need to connect to an existing quickbooks database in one of two ways.</p>
  
  <p>1) either directly from a php script running on our web site -- insert user supplied data directly from web to quickbooks.</p>
  
  <p>or </p>
  
  <p>2) put user's data directly into mySQL database and later export data from mySQL to quickbooks.</p>
  
  <p>If the first option is viable, I would appreciate your thoughts on establishing an odbc connection to the quickbooks database.</p>
  
  <p>can I go about it with something like:</p>
  
  <pre><code>try {
    $conn = @odbc_connect("DSNName", "", "", "SQL_CUR_USE_ODBC");
    // un and pw parameters are passed as empty strings since the DSN 
    // has knowledge of the password already.
    // 4th parameter is optional
  
    $exec = @odbc_exec($conn, $insert) or die ("exec error");
    echo "success!";
  }
  catch (Exception $e) {
    echo $e-&gt;getMessage();
  } // end try catch
  </code></pre>