mercredi 24 novembre 2021

Change table name not working with another database connection

I created a Model with another connection string and change table name to answer_sheet_omr.

{
    //protected $table='answer_sheet_omr';
    protected $connection = 'mysql2';
    protected $table='answer_sheet_omr';

} 

But after that show the following error SQLSTATE[42S02]: Base table or view not found: 1146 Table 'hmsprawq_hmspro.answer_sheet_omr'

hmsprawq_hmspro is my default database not in mysql2 database connection.

I need an help to change table name with another database connection.



via Chebli Mohamed

Aucun commentaire:

Enregistrer un commentaire