title: SQL Query result, comparison and where clause
body: <p>I am building a site and i need to retrieve some information. I have this query.</p>
  
  <pre><code>$SQL = "SELECT distretto_108, provinca_113, regioni_116, tipologia_pdv_106, 
          richiesta_ccnl_107, coop_va_109, nome_pdv_110, 
          indirizzo_pdv_111, localita_112 
          FROM civicrm_value_informazioni_su_tute_le_schede_p_22 ";  
  </code></pre>
  
  <p>I need to add this other code: </p>
  
  <pre><code>WHERE civicrm_event.title_en_US='".addslashes($_GET["titles"])."' 
  </code></pre>
  
  <p>but it's not working...
  i need to compare let's say the id of another table with the id of the current table... How to do that?</p>
  
  <p>Thanks in advance...</p>