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

Get Channel entry by other means (not entry_id)

Development and Programming

Jayson Ng's avatar
Jayson Ng
67 posts
15 years ago
Jayson Ng's avatar Jayson Ng

Is there a built in way to get channel entry details other than ‘entry_id’ ?

channel_entries_model has a ‘get_entry’ method but only takes entry_id as the option.

what if, like how i need it now, I need to get details based on the ‘title’ from channel_titles table.

is there a method for that or do I need to create one on my own?

thanks,

       
hd 's avatar
hd 
156 posts
15 years ago
hd 's avatar hd 

I’d use something like this… Though if there is a better way I’m all ears my self.

$this->EE->db->where('title', $title);
$this->EE->db->where_in('site_id', $site_ids);
$this->EE->db->where_in('channel_id', $channel_ids);
$query = $this->EE->db->get('channel_titles'); 
if ($query->num_rows() > 0){
     $entries = $query->result_array();
     ...
}
       

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.