title: Best way to use a custom table in a relationship (in ExpressionEngine)?
body: <p>So, I’m a bit on how to use a separate table in a relationship, or something like that…</p>
  
  <p>I have a table with around 5000 hotels called <code>exp_h_hotels</code>.<br>
  On my website, I use the <code>pages</code> module to create a static subpage for each part of the country.   I want to list all hotels that belong to a specific region. </p>
  
  <p>I have understood that I can’t do something like this (using ExpressionEngine tags with the query module):</p>
  
  <pre><code>{exp:query sql="SELECT * FROM exp_h_hotels WHERE h_regionname ='{regionname}'"}
         {hotel_name}
  {/exp:query} 
  </code></pre>
  
  <p>Anyone knows the best way to go forward with this?</p>
  
  <p>I have looked into using the ExpressionEngine API to insert the data into a channel – however, I get the feeling that it wouldn’t be optimal to flood the channel entries table with 5000 posts with 14-20 fields with data each.</p>