Click here to Skip to main content
15,891,567 members
Please Sign up or sign in to vote.
1.00/5 (2 votes)
See more:
Hello I have created a view for users table. When I query it , It gives error General error: 1615 Prepared statement needs to be re-prepared

I have tried the solutions given in this forum i.e in config/database.php

PDO::ATTR_EMULATE_PREPARES => true

also tried to change

table_open_cache 128=>16384
table_definition_cache 1024=>16384

in mysql.cnf

I am using laravel 5.4 MariaDB version 10.1.26-MariaDB

My user model code is
PHP
class User extends SnipeModel implements AuthenticatableContract, CanResetPasswordContract
{
    protected $presenter = 'App\Presenters\UserPresenter';
    use SoftDeletes, ValidatingTrait;
    use Authenticatable, Authorizable, CanResetPassword, HasApiTokens;
    use UniqueUndeletedTrait;
    use Notifiable;
    use Presentable;
    protected $dates = ['deleted_at'];
    protected $hidden = ['password','remember_token','permissions','reset_password_code','persist_code'];
    protected $table = 'users';
    protected $injectUniqueIdentifier = true;
    protected $fillable = [
        'activated',
        'address',
        'city',
        'company_id',
        'country',
        'department_id',
        'email',
        'employee_num',
        'first_name',
        'jobtitle',
        'last_name',
        'ldap_import',
        'locale',
        'location_id',
        'manager_id',
        'password',
        'phone',
        'state',
        'username',
        'zip',
    ];

    protected $casts = [
        'activated' => 'boolean',
    ];


What I have tried:

I have tried in config/database.php
PDO::ATTR_EMULATE_PREPARES => true

and

also tried to change

table_open_cache 128=>16384
table_definition_cache 1024=>16384
Posted
Updated 31-Aug-18 2:53am
Comments
Richard MacCutchan 31-Aug-18 8:19am    
It is not a lot of use randomly changing things in the hope that you will somehow stumble upon a solution. You need to check the documentation to see exactly what are the causes of this error, and then work from there.

1 solution

 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900