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

Can you use channels in a plugin's SQL call?

Development and Programming

MTWIGG's avatar
MTWIGG
8 posts
13 years ago
MTWIGG's avatar MTWIGG

I am working on a website where the core of the code is in a plugin. The plugin contains calls like this…

SELECT field_id_206 FROM exp_channel_data WHERE field_id_206>20

What I would like to do is replace the hard coded field ids (e.g. field_id_206) with channel tags (e.g. {holiday})

The above example is trivial to do using just channels, but in this specific case the database contains both Expression Engine and none Expression Engine tables and so I have to write my own SQL calls to access them.

I know I could use calls to exp_channel_fields to find the channel ids, but I am hoping for something cleaner.

       

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.