Yii Framework Forum: Help in Getting Started using WAMP MySQL - Yii Framework Forum

Jump to content

Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

Help in Getting Started using WAMP MySQL Rate Topic: -----

#1 User is offline   faizalmansor 

  • Newbie
  • Yii
  • Group: Members
  • Posts: 3
  • Joined: 15-December 08

Posted 15 December 2008 - 04:35 AM

I've set up the "testdrive" application using the Definitive Guide (yii-guide-1.0.0.pdf). I've encountered a problem when trying the CRUD command using the Yii Interactive Tool v1.0, (i.e. when using "crud User" command).
However, when using the "model User" command, I do not encounter any problem and the model was created successfully.

Error message:
Error: Table "User" does not have a primary key

Primary key was set on the said table:
CREATE TABLE `user` (
  `id` int(11) NOT NULL auto_increment,
  `username` varchar(128) NOT NULL,
  `password` varchar(128) NOT NULL,
  `email` varchar(128) NOT NULL,
  PRIMARY KEY  (`id`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1 AUTO_INCREMENT=1 ;

I have tried both using either MyISAM,  InnoDB engine.

Any help would be GREATLY appreciated.
Thanks.

***********************************
My development environment is as the following:
Wampserver 2.0
Apache Version : 2.2.8 
PHP Version : 5.2.6 
Loaded Extensions :
        * bcmath
        * calendar
        * com_dotnet
        * ctype
        * session
        * filter
        * ftp
        * hash
        * iconv
        * json
        * odbc
        * pcre
        * Reflection
        * date
        * libxml
        * standard
        * tokenizer
        * zlib
        * SimpleXML
        * dom
        * SPL
        * wddx
        * xml
        * xmlreader
        * xmlwriter
        * apache2handler
        * gd
        * mbstring
        * mysql
        * mysqli
        * PDO
        * pdo_mysql
        * soap
        * SQLite

MySQL Version : 5.0.51b 
0

#2 User is offline   lupo 

  • Newbie
  • Yii
  • Group: Members
  • Posts: 5
  • Joined: 07-December 08

Posted 15 December 2008 - 05:55 AM

Hello

I had the same behaviour. My problem was, that the php_pdo and php_pdo_sqlite extensions were not enabled for the command line version of php. It uses another php.ini file than the apache server.
See the red backgrounded boxes in the "Definitive Guide to Yii" in the Chaptre "Creating First Yii Application".

After changing the correct php.ini file (and restarting the shell) it worked.

0

#3 User is offline   faizalmansor 

  • Newbie
  • Yii
  • Group: Members
  • Posts: 3
  • Joined: 15-December 08

Posted 15 December 2008 - 08:35 AM

@lupo,

Thank you very much for your suggestion. Problem solved after I restarted the shell. So, lesson learned: Restart yiic shell after enabling the php PDO extension on the Wampserver.

Thanks!  ;D

0

#4 User is offline   beatniak 

  • Newbie
  • Yii
  • Group: Members
  • Posts: 6
  • Joined: 24-March 09

Posted 24 March 2009 - 08:24 AM

ah, that was helpfull. Rebooting the shell did the trick.
(I was only rebooting apache : )
0

Share this topic:


Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

1 User(s) are reading this topic
0 members, 1 guests, 0 anonymous users