We use cookies to improve your experience. No personal information is gathered and we don't serve ads. Cookies Policy.

ExpressionEngine Logo ExpressionEngine
Features Pricing Support Find A Developer
Partners Upgrades
Blog Add-Ons Learn
Docs Forums University
Log In or Sign Up
Log In Sign Up
ExpressionEngine Logo
Features Pro new Support Find A Developer
Partners Upgrades
Blog Add-Ons Learn
Docs Forums University Blog
  • Home
  • Forums

Best way to use a custom table in a relationship?

Development and Programming

kitsune's avatar
kitsune
2 posts
14 years ago
kitsune's avatar kitsune

Hello again guys.

So, I’m a bit on how to use a separate table in a relationship, or something like that…

Anyhow, lets say that I have a table with around 5000 hotels (lets say that it is called exp_h_hotels). On my website, I use the pages module to create a static subpage for each part of the country. Now, I want to somehow list all the hotels that belong to a specific region.

Now – I have understod that I can’t do something like this (using ExpressionEngine tags with the query module):

{exp:query sql="SELECT * FROM exp_h_hotels WHERE h_regionname ='{regionname}'"}
       {hotel_name}
{/exp:query}

Anyone knows the best way to go forward with this?

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.

       
kitsune's avatar
kitsune
2 posts
14 years ago
kitsune's avatar kitsune

Doesn’t seem to be much action here in the forums 😉

Anyhow, if I ask like this then:

Is it posible to use a variable that I pass on via an embed in an SQL-query? I’ve seen examples for it, but can’t get it to work.

       

Reply

Sign In To Reply

ExpressionEngine Home Features Pro Contact Version Support
Learn Docs University Forums
Resources Support Add-Ons Partners Blog
Privacy Terms Trademark Use License

Packet Tide owns and develops ExpressionEngine. © Packet Tide, All Rights Reserved.