title: How can I feed a mysql database with a XHTML table, or filter this table any other way?
body: <p>I have to work with a third party database which doesn't allow the kind of requests and filters I need to use on it.</p>
  
  <p>It possesses a very basic API to request broad datas from it, which returns the datas as an XHTML form (which is, in fact a <code>&lt;table&gt;</code> with <code>&lt;th&gt;</code> column titles and unlabeled <code>&lt;td&gt;</code> cells).</p>
  
  <p>What I need is a way to filter the content of this table, with various criteria that I can't put in the original request through the API.</p>
  
  <p>So I have to turn my XHTML table into a mySQL table of some sort, in order to make specific requests on it.</p>
  
  <p>What I imagine would work this way :</p>
  
  <ol>
  <li>Web app is opened </li>
  <li>It requests the fresh datas from the third party database</li>
  <li>Get the XHTML table as a result </li>
  <li>Works some parsing magic on it </li>
  <li>Shove it into my MySQL database (truncate and update a table wich replicate the <code>&lt;table&gt;</code> structure) </li>
  <li>Let me request however I want my own mirror database</li>
  </ol>
  
  <p>I wondering if this is the simplest way of doing it, and if so how best should I proceed to do it ?</p>
  
  <p>Should I parse the XHTML table to make it SQL-ready ? If so, how ?
  Or parse and insert it line by line, but then how should I transform my table into an array of lines ?</p>
  
  <p>Or is there some magical way to do a "SELECT x FROM <code>&lt;table&gt;</code> WHERE <code>&lt;column&gt;</code> = <code>&lt;value&gt;</code> AND <code>&lt;other stuff&gt;</code>" on a XHTML table directly ?</p>
  
  <p>Any advice appreciated !</p>