FIX
http://www.apachefri…hp?f=16&t=32617
The entire problem is due to an error in XAMPP 1.7 Replaced the mysql dll and things finally work.
UPDATE
Biting the bullet I followed the example completely and used an SqLite database. It worked fine. Switched back to MySQL executing the exact same commands in the shell (I did stop/start the shell to reload the configuration changes) and the command fails by crashing the shell silently.
// uncomment the following to set up database 'db'=>array( //'connectionString'=>'sqlite:protected/data/test.db', 'class'=>'CDbConnection', 'connectionString'=>'mysql:host=localhost;dbname=mysql', 'username' => 'root', 'password' => '', ),
With sqlite enabled it works as documented in the tutorial.
With mysql enabled it crashes after the command "model User user generate User.php" or "model User" or "model User user" or "crud User".
I added the class part later as some forums posts suggest this. With or without the same result. I can execute regular "mysql_connect"statements from the shell and they work fine.
>> $connection = new CDbConnection("mysql:host=localhost;dbname=dutchbox","root"
,'');
>> $connection->active=true
>> $command=$connection->createCommand("select * from user");
>> $dr = $command->query();
CRASH
I think therefor there is something wrong with my database. As you can see I resorted to connecting to mysql's own internat database in case something was wrong with the one I created but the same thing happens.
I am trying to follow the tutorial but am stuck on the bit where you have to use the modal command in the shell to create some php based on your database scheme.
I am using mysql instead of SQLite but have corrected the db connection paramater as documented in the comments.
The problem is that the command given doesn't seem to work. The "help model" hint seems outdated as it only mentions 2 parameters.
The command is supposed to be "model User generate User.php" I presume on ONE line (very unclear if this is the case from the documentation. However the inline help suggests "model classname tablename". I have tried various combo's.
>> model User generate User.php
Warning: the table 'generate' does not exist in the database.
exist User.php
…overwrite? [Yes|No|All|Quit] y
overwrite User.php
The 'User' class has been successfully created in the following file:
D:\xampp\htdocs\testdrive\protected\models\User.php
If you have a 'db' database connection, you can test it now with:
$model=User::model()->find();
print_r($model);
What table generate? Isn't that the command? Leaving it out doesn't work.
What exactly is the command to execute? I have tried multiple variations and just can't figure it out.