Creating New User in Yii command line - STILL NEED HELP

Wow - I really love this Yii

so to make sure i understand the blog tutorial – I started doing it again from the start

I am also following along the Video tutorial (great job!)

– in the video it seems that the user is created while in the protected directory

but

i get an error if i do that

so

i do it from the www/blog directory

then I enter this

$u - new user

$u->username='admin';

$u->password=md5('admin');

so far i get no error

but when i enter

$u->save();

i then get a FATAL ERROR

the first time itried this last week it worked

i am confused why this time it did not

any tips?

thank you in advance - i really would appreciate assistance, cause i want to be good at Yii

FATAL ERROR is not enough to help you fix this problem.

Try in console mode retrieve some values.

Something like: $myModel->model()->findAll();

Hi,

Thanks for your assistance.

The exact ERROR message is this:

============================================================

Fatal Error: Call to undefined method stdClass::save() in C;\wamp\www\yii\framework\cli\commands\ShellCommand.php(139) : val()'d code on line 1

============================================================

any idea what is wrong?

it worked the first time I tried it last week

Are you sure you  are calling $user->save() ? The error stdClass::save() means you are calling user::save().

yes

I type this:

$u->save();

and I get that error

i just exited the command line console

then restarted it again

then repeated the steps again

but no luck

same error

i'm determined to solve this

got my bottle of aspirin out

fully loaded

i think you will be the key to the solution - you seem to know your Yii

Quote

Are you sure you  are calling $user->save() ? The error stdClass::save() means you are calling user::save().

i am in the blog directory – not in the blog/protected directory

which directory should i be in?

or does it matter?

Thanks


$u - new user

$u->username='admin';

$u->password=md5('admin');

It is supposed to be


$u = new user;

not


$u - new user

.

Try if this is the problem.