B
B
Bogdan Pasechnik2013-11-18 11:25:50
MySQL
Bogdan Pasechnik, 2013-11-18 11:25:50

Why did ActiveRecord access stop working in Yii?

I make 2 requests.

Yii::app()->db->createCommand()->select('*')->from('{{news}}')->queryRow();

News::model()->find();
The first one works. The second one throws an error
The table "{{news}}" referred to in the active record of the "News" class was not found in the database.
Until today, the site worked. I did not find any changes in the code. I have no idea how this could be...

Answer the question

In order to leave comments, you need to log in

4 answer(s)
B
Bogdan Pasechnik, 2013-11-22
@taral

I apologize for the delay in reply.
The problem was very interesting. I could not find out 100% what it was, because when I sent a request to the hoster, he corrected the error. But the bottom line was that the space allocated for the database ended or something like that.
I assume that the situation is as follows. createCommand worked because it loaded the request less into the muscle. And the automatic generation of the request with the ORM no longer pulled it.

L
LionAlex, 2013-11-18
@LionAlex

The code of the News class should be looked at, most likely there is a problem in it.

B
Boris Syomov, 2013-11-18
@kotomyava

Do you have any database schema cached?
If yes, try resetting the cache.

M
Mikhail Osher, 2013-11-18
@miraage

What about the tableName() method in the News model? Usually braces are used when table_prefix comes.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question