@rartg

Error (#8) Yii2,в чем может быть проблема?

Писал сайт на Yii2 на виртуалке всё прекрасно работает,при загрузки в сеть возникла такая проблема.Есть база с таблицами,одно чисто текстовая из нескольких полей остальные текст+фото.
Первая таблица без каких либо проблем выводиться и отображается,при переходе на другие вкладки где есть таблица бьет ошибку Error (#8),кто нибудь знает решение проблемы?Заранее спасибо.
Код с подключением бд
<?php

return [
    'class' => 'yii\db\Connection',
    'dsn' => 'mysql:host=localhost;dbname=yii2raspisanie',
    'username' => 'zimudar',
    'password' => '123',
    'charset' => 'utf8',

    // Schema cache options (for production environment)
    //'enableSchemaCache' => true,
    //'schemaCacheDuration' => 60,
    //'schemaCache' => 'cache',
];


Код с контролером
<?php
namespace app\controllers;
use Yii;
use yii\filters\AccessControl;
use yii\web\Controller;
use yii\web\Response;
use yii\filters\VerbFilter;
use app\models\LoginForm;
use app\models\ContactForm;
use app\models\Yii2raspisanie;
use app\models\Comtact;
use app\models\Lecturers;
use app\models\Partners;
class SiteController extends Controller
{
    /**
     * {@inheritdoc}
     */
    public function behaviors()
    {
        return [
            'access' => [
                'class' => AccessControl::className(),
                'only' => ['logout'],
                'rules' => [
                    [
                        'actions' => ['logout'],
                        'allow' => true,
                        'roles' => ['@'],
                    ],
                ],
            ],
            'verbs' => [
                'class' => VerbFilter::className(),
                'actions' => [
                    'logout' => ['post'],
                ],
            ],
        ];
    }

    /**
     * {@inheritdoc}
     */

    public function actions()
    {
        return [
            'error' => [
                'class' => 'yii\web\ErrorAction',
            ],
            'captcha' => [
                'class' => 'yii\captcha\CaptchaAction',
                'fixedVerifyCode' => YII_ENV_TEST ? 'testme' : null,
            ],
        ];
    }

    /**
     * Displays homepage.
     *
     * @return string
     */
    public function actionAboutcompany(){
      $lecturers = Lecturers::find()->orderBy('id DESC')->all();
        $partners = Partners::find()->orderBy('id DESC')->all();
      return $this->render('aboutcompany', compact('lecturers','partners'));


      }
      /**
       * Displays homepage.
       *
       * @return string
       */
      public function actionPartners(){
        $partners = Partners::find()->orderBy('id DESC')->all();
        return $this->render('partners', compact('partners'));
        }
    /**
     * Displays homepage.
     *
     * @return string
     */
    public function actionIndex()
    {
      $posts = Yii2raspisanie::find()->select('id,month,date,text')->orderBy('id DESC')-> limit(3) ->all();
      return $this->render('index', compact('posts'));
    }
    /**
     * Displays about page.
     *
     * @return string
     */
    public function actionAbout()
    {
      $posts1 = Comtact::find()->orderBy('id DESC')->all();
      //$this->debug($posts);
      //debug($posts1);
      return $this->render('about', compact('posts1'));
    }


    /**
     * Login action.
     *
     * @return Response|string
     */
    public function actionLogin()
    {
        if (!Yii::$app->user->isGuest) {
            return $this->goHome();
        }

        $model = new LoginForm();
        if ($model->load(Yii::$app->request->post()) && $model->login()) {
            return $this->goBack();
        }

        $model->password = '';
        return $this->render('login', [
            'model' => $model,
        ]);
    }

    /**
     * Logout action.
     *
     * @return Response
     */
    public function actionLogout()
    {
        Yii::$app->user->logout();

        return $this->goHome();
    }

    /**
     * Displays contact page.
     *
     * @return Response|string
     */
    public function actionContact()
    {
        $model = new ContactForm();
        if ($model->load(Yii::$app->request->post()) && $model->contact(Yii::$app->params['adminEmail'])) {
            Yii::$app->session->setFlash('contactFormSubmitted');

            return $this->refresh();
        }
        return $this->render('contact', [
            'model' => $model,
        ]);
    }



    public function actionExpertise()
    {
    return $this->render('expertise');
 }
 public function actionQualification()
 {
 return $this->render('qualification');
}




public function actionFormcont()
{
return $this->render('formcont');
}
}

?>
  • Вопрос задан
  • 820 просмотров
Пригласить эксперта
Ответы на вопрос 1
@rartg Автор вопроса
Стоит еще images costarico убрал вывод картинок заработало,но опять же новый вопрос как теперь вывести картинки:?
Ответ написан
Комментировать
Ваш ответ на вопрос

Войдите, чтобы написать ответ

Войти через центр авторизации
Похожие вопросы