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

Updating Plugin to 2.0 Error: Entries Number

Development and Programming

jose riveros's avatar
jose riveros
14 posts
15 years ago
jose riveros's avatar jose riveros

As this plugin won’t be updated for quite some time, I decided to go ahead and try to do it myself.

Not being a developer nor knowing php, I’m hoping to get some clarification about the following error message after updating the code (based on the EE documentation):

Error Error Number: 1054 Unknown column ‘exp_channels.blog_name’ in ‘field list’ SELECT exp_channel_titles.url_title, exp_channel_titles.title, exp_channel_titles.entry_id, exp_channel_titles.status, exp_channel_titles.expiration_date, exp_channel_titles.author_id, exp_channels.blog_name FROM exp_channel_titles, exp_channels , exp_category_posts WHERE exp_channel_titles.channel_id=exp_channels.channel_id AND exp_category_posts.entry_id=exp_channel_titles.entry_id AND exp_category_posts.cat_id=‘1’

The code in question relates to a SQL query string:

// Create SQL query string
      $todo = "SELECT ".$distinctoperator." exp_channel_titles.url_title, exp_channel_titles.title, exp_channel_titles.entry_id, exp_channel_titles.status, exp_channel_titles.expiration_date, exp_channel_titles.author_id, exp_channels.blog_name FROM exp_channel_titles, exp_channels ".$categorytablesclause." WHERE exp_channel_titles.channel_id=exp_channels.channel_id ";
      $todo .= $entryidequalityclause.$categoryidclause.$channelclause.$urltitleclause.$entryidclause.$statusclause.$authoridclause.$siteclause.$groupbyclause.$havingclause;
      //echo '$todo: '.$todo.'

';
      
      // Perform SQL query
      
      $query = $this->EE->db->query($todo);

Note that the plugin works fine in 1.6.9. The original query is:

// Perform SQL query
      $query = $DB->query($todo);

Any help would be greatly appreciated.

I have attached the plugin file to this post.

       
John Henry Donovan's avatar
John Henry Donovan
12,339 posts
15 years ago
John Henry Donovan's avatar John Henry Donovan

jose,

I am going to move this thread here to the Plug-ins forum as it is more appropriate there

       

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.