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

  • Home
  • SEARCH
  • 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 3340532
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 18, 20262026-05-18T00:37:07+00:00 2026-05-18T00:37:07+00:00

My model <?php // Connection Component Binding Doctrine_Manager::getInstance()->bindComponent(‘Identiti_Model_Akses’, ‘doctrine’); /** * Identiti_Model_BaseAkses * *

  • 0

My model

<?php
// Connection Component Binding
Doctrine_Manager::getInstance()->bindComponent('Identiti_Model_Akses', 'doctrine');

/**
 * Identiti_Model_BaseAkses
 * 
 * This class has been auto-generated by the Doctrine ORM Framework
 * 
 * @property string $nostaf
 * @property integer $id_aplikasi
 * 
 * @package    ##PACKAGE##
 * @subpackage ##SUBPACKAGE##
 * @author     ##NAME## <##EMAIL##>
 * @version    SVN: $Id: Builder.php 7490 2010-03-29 19:53:27Z jwage $
 */
abstract class Identiti_Model_BaseAkses extends Doctrine_Record
{
    public function setTableDefinition()
    {
        $this->setTableName('akses');
        $this->hasColumn('nostaf', 'string', 12, array(
             'type' => 'string',
             'length' => 12,
             'fixed' => false,
             'unsigned' => false,
             'primary' => false,
             'notnull' => true,
             'autoincrement' => false,
             ));
        $this->hasColumn('id_aplikasi', 'integer', 4, array(
             'type' => 'integer',
             'length' => 4,
             'fixed' => false,
             'unsigned' => false,
             'primary' => false,
             'notnull' => true,
             'autoincrement' => false,
             ));
    }

    public function setUp()
    {
        parent::setUp();
    }
}

My actual table:

mysql> desc akses;
+-------------+-------------+------+-----+---------+-------+
| Field       | Type        | Null | Key | Default | Extra |
+-------------+-------------+------+-----+---------+-------+
| nostaf      | varchar(12) | NO   |     | NULL    |       |
| id_aplikasi | int(11)     | NO   |     | NULL    |       |
+-------------+-------------+------+-----+---------+-------+

My code:

$q = Doctrine_Query::create()                  
      ->from('Identiti_Model_Akses a');
$result = $q->execute();

My error:

SQLSTATE[42S22]: Column not found: 1054 Unknown column 'a.id' in 'field list'. Failing Query: "SELECT a.id AS a__id, a.nostaf AS a__nostaf, a.id_aplikasi AS a__id_aplikasi FROM akses a" 

I think it has something to do with the table itself (it doesn’t have any primary key). I’ve tried setting one of them as the primary key and the query doesn’t output the same error anymore.

  • 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-18T00:37:07+00:00Added an answer on May 18, 2026 at 12:37 am

    Doctrine requires that a primary key is set. By default if you don’t have one set it will assume ‘id’ is the PK and attempt to select it. There is not a work around for this. You’re best off adding a PK with an auto increment.

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

Sidebar

Related Questions

I have a rails model that looks something like this: class Recipe < ActiveRecord::Base
class Tag(models.Model): name = models.CharField(maxlength=100) class Blog(models.Model): name = models.CharField(maxlength=100) tags = models.ManyToManyField(Tag) Simple
My Invoice model has an address_id attribute, and I don't want this address_id to
I'm new to PHP so I apologize if this seems silly. I've searched around
My question is how does one abstract a database connection from the model layer
Is there anything wrong with this (User model, line 95): scope :by_recent, where('created_at BETWEEN
I have Django models as follows: class Subject(models.Model): name = models.CharField(max_length=35, unique=True) class Book(models.Model):
I have an ASCII file that contains tab-delimited data like this: Test_Version=2.5.3 Model-Manufacturer=D12-500 Test_Version=2.5.3
Whenever I indent HTML in PHP mode, emacs (22.1.1, basic install on Redaht Linux
When running PHP in CLI mode, most of the time (not always), the script

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.