0
votes

I am a beginner to cakephp and started to look into the tutorials after successfully installing and configuring. I created a database in MySQL and created a table users that contains the attributes email, password, created and email being the primary key.

I ran a command bake all users in order to auto generate code. When I tried to add new user by going to http://<path>/users it is only asking for password field but not email field and an empty space is getting inserted for email field. And when I tried to add another user it is showing an error that value of primary key should be different. Where am I doing wrong?

1
Show some generated code... And set id for that table, did you create table without id? - skywalker
As suggested by Insane Skull, please post your code and you will have more chances to find help. See which is the better way to ask at stack overflow stackoverflow.com/help/mcve - terence hill
@skywalker yes i didn't created any id. It was there in the tutorial but I ignored it as I don't want. Is it necessary? - Mani Sankar
All tables should have id field, and your email field can be unique if you want that. - skywalker

1 Answers

0
votes

run the following command

cake bake all

and choose your database, hope it helps

if it still doesn't work , may be your path is not set. refer the following link http://nurelm.com/running-cakephp-command-line-tools-in-windows/

Right click on my computer>>Properties>>Change settings(in that workgroup settings area) >> Advanced .. etc set the path and then it should work