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.



from Newest questions tagged laravel-5 - Stack Overflow https://ift.tt/3xkeb8f
via IFTTT

Aucun commentaire:

Enregistrer un commentaire