This forum is in READ-ONLY mode.
You can look around, but if you want to ask a new question, please use Stack Overflow.

Day 4 Fatal Error

Discussion around this tutorial for symfony 1.0.x

Day 4 Fatal Error

by guych » Thu May 15, 2008 9:54 am

Hello. I followed lesson instructions and, on 4. day i had a problem.

when i run
$ php batch/load_data.php
this command.

i get this fatal error :

Fatal error : uncaught exception 'PropelException' with message 'Cannot fetch TableMap for undefined table : ask_question'

on windows system.

Can u plz help to me.
guych
Junior Member
 
Posts: 5
Joined: Thu May 15, 2008 9:46 am

Re: Day 4 Fatal Error

by snowkrash » Thu May 15, 2008 9:58 am

Are your Propel model classes generated correctly ánd have you cleared your cache after this?
snowkrash
Faithful Member
 
Posts: 518
Joined: Thu Jul 13, 2006 4:48 pm
Location: The Netherlands

Re: Day 4 Fatal Error

by guych » Thu May 15, 2008 10:10 am

I followed instructions of the lesson. I did nothing diffirent then.
And i did not clear cache.
when i should clear cache ?
guych
Junior Member
 
Posts: 5
Joined: Thu May 15, 2008 9:46 am

Re: Day 4 Fatal Error

by guych » Thu May 15, 2008 10:14 am

symfony clear-cache
again
php load_data.php

same problem. same errors.
guych
Junior Member
 
Posts: 5
Joined: Thu May 15, 2008 9:46 am

Re: Day 4 Fatal Error

by snowkrash » Thu May 15, 2008 10:37 am

It seems that the table ask_question doesn't exist.

You should always clear the cache after changes in configuration or when new library classes are created or deleted. For example after you created the model classes with propel-create-model.

Are you sure you created the schema.yml correctly with the AskQuestionmodel?
snowkrash
Faithful Member
 
Posts: 518
Joined: Thu Jul 13, 2006 4:48 pm
Location: The Netherlands

Re: Day 4 Fatal Error

by mercure80 » Mon Jul 28, 2008 9:27 pm

Hello!

I'm new to symfony and I am following the askeet tutorial online. I had the exact same issue as described here. When I try to feed the database with new data, I get the following error message:

Uncaught exception 'PropelException' with message 'Cannot fetch TableMap for undefined table: ask_question'.

The "ask_question" table does exist in the database. I've tried to clear the cache, and verify my schema.yml file, everything seems all right to me.

Then, I realized that instead of adding - as in appending - the new test data, I had removed the old data. Since symfony by default deletes the old data before adding the new one, I suspect that it caused some issues. Now when I execute load_data.php with all the test data altogether, it works.

G'luck!

Marc-O.
mercure80
Junior Member
 
Posts: 8
Joined: Mon Jul 28, 2008 9:24 pm
Location: Quebec, Canada