title: zend Framework quickstart A table must have a primary key, but none was found
body: <p>I am following the: <a href="http://framework.zend.com/manual/en/learning.quickstart.create-model.html" rel="nofollow">http://framework.zend.com/manual/en/learning.quickstart.create-model.html</a>. </p>
  
  <p>Keep hitting wall after wall of issues. My current one is the following error:</p>
  
  <pre><code>An error occurred
  
  Application error
  
  Exception information:
  
  Message: A table must have a primary key, but none was found
  
  Stack trace:
  
  #0 C:\wamp\www\zendtest\quickstart\library\Zend\Db\Table\Abstract.php(982): Zend_Db_Table_Abstract-&gt;_setupPrimaryKey()
  #1 C:\wamp\www\zendtest\quickstart\library\Zend\Db\Table\Select.php(100): Zend_Db_Table_Abstract-&gt;info()
  #2 C:\wamp\www\zendtest\quickstart\library\Zend\Db\Table\Select.php(78): Zend_Db_Table_Select-&gt;setTable(Object(Application_Model_DbTable_Guestbook))
  #3 C:\wamp\www\zendtest\quickstart\library\Zend\Db\Table\Abstract.php(1018): Zend_Db_Table_Select-&gt;__construct(Object(Application_Model_DbTable_Guestbook))
  #4 C:\wamp\www\zendtest\quickstart\library\Zend\Db\Table\Abstract.php(1326): Zend_Db_Table_Abstract-&gt;select()
  #5 C:\wamp\www\zendtest\quickstart\application\models\GuestbookMapper.php(58): Zend_Db_Table_Abstract-&gt;fetchAll()
  #6 C:\wamp\www\zendtest\quickstart\application\controllers\GuestbookController.php(14): Application_Model_GuestbookMapper-&gt;fetchAll()
  #7 C:\wamp\www\zendtest\quickstart\library\Zend\Controller\Action.php(516): GuestbookController-&gt;indexAction()
  #8 C:\wamp\www\zendtest\quickstart\library\Zend\Controller\Dispatcher\Standard.php(295): Zend_Controller_Action-&gt;dispatch('indexAction')
  #9 C:\wamp\www\zendtest\quickstart\library\Zend\Controller\Front.php(954): Zend_Controller_Dispatcher_Standard-&gt;dispatch(Object(Zend_Controller_Request_Http), Object(Zend_Controller_Response_Http))
  #10 C:\wamp\www\zendtest\quickstart\library\Zend\Application\Bootstrap\Bootstrap.php(97): Zend_Controller_Front-&gt;dispatch()
  #11 C:\wamp\www\zendtest\quickstart\library\Zend\Application.php(366): Zend_Application_Bootstrap_Bootstrap-&gt;run()
  #12 C:\wamp\www\zendtest\quickstart\public\index.php(26): Zend_Application-&gt;run()
  #13 {main}  
  Request Parameters:
  
  array (
    'controller' =&gt; 'guestbook',
    'action' =&gt; 'index',
    'module' =&gt; 'default',
  )  
  </code></pre>
  
  <p>But I am sure my table has a primary key code for table:</p>
  
  <pre><code>CREATE TABLE guestbook (
      id INTEGER NOT NULL PRIMARY KEY AUTOINCREMENT,
      email VARCHAR(32) NOT NULL DEFAULT 'noemail@test.com',
      comment TEXT NULL,
      created DATETIME NOT NULL
  );
  
  CREATE INDEX "id" ON "guestbook" ("id");
  </code></pre>
  
  <p>Don't understand why getting error </p>