Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6532261
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T09:58:45+00:00 2026-05-25T09:58:45+00:00

I am giving Kohana a try and I was trying to use the ORM

  • 0

I am giving Kohana a try and I was trying to use the ORM + PDO + MySQL database, and I don’t seem to find an answer in google or SO.

I have both the database and ORM modules enabled, and I have set PDO as default in modules/database/config/database.php

I have a simple controller, and a simple model:

MODEL application/classes/model/blogpost.php:

<?php
class Model_Blogpost extends ORM {
    protected $_table_name  = 'blog_post'; 
}

CONTROLLER: in application/classes/controller/welcome.php

<?php defined('SYSPATH') or die('No direct script access.');

class Controller_Welcome extends Controller {

  public function action_index() {

    $Blog_Post = ORM::factory('blogpost');    // ==> ERROR HERE

    $Blog_Post->name = 'test1';
    $Blog_Post->description = 'this is a quick test';
    $Blog_Post->content = 'The content goes here....';
    $Blog_Post->save();

    $id = $Blog_Post->id;

    $Blog_Post = ORM::factory('blogpost', $id);
    $view->Blog_Post = $Blog_Post;

    $this->response->body($view);
  }
} // End Welcome

I get the following error when I try to run the test:

Kohana_Exception [ 0 ]: Database method list_columns is not supported by Kohana_Database_PDO

I have done a search in google and Stack Overflow, and my impression is that ORM may not work with PDO, is this correct? or am I missing something?

Thank you.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-25T09:58:45+00:00Added an answer on May 25, 2026 at 9:58 am

    list_columns is used for ORM to get all the columns in a table when they are not specified. To get around this, you can specify the table columns in the _table_columns protected property:

    class Model_Blogpost extends ORM {
      protected $_table_name  = 'blog_post';
      protected $_table_columns = array(
        'column1' => NULL,
        'column2' => NULL,
        // ...
        'columnx' => NULL,
      ); 
    }
    

    This will ensure that list_columns is not called. The downside is that you will have to keep track of every change to the table you make. The upside is that an extra SHOW FULL COLUMNS query is not called, meaning a small performance boost.

    Another way is to override the list_columns method and provide your own means of listing columns with it.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Gradle is giving me fits. I have a build.gravle that includes the java plug-in
Google Webmaster Tools is giving me loads of crawl Errors of a certain type
Have the following select giving me the data I want, but I want to
I'm just giving a try to unit testing in javascript/coffeescript with jasmine, very nice.
giving a database table with huge data in it, what is the best practice
MySQL is giving a 1064 on an escaped string. $date is set above. $article_clean
I am giving Vim xdebug plugin a try, but when I put cursor on
Giving a little background info: Details.cshtml contains a title (uses model Category), I have
After giving up on PHP I'm trying to extract data from the xml using
I'm giving a try to PascalScript, due to its features which could be very

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.