title: Import of 50K+ Records in MySQL Gives General error: 1390 Prepared statement contains too many placeholders
body: <p>Has anyone ever come across this error: General error: 1390 Prepared statement contains too many placeholders</p>
  
  <p>I just did an import via SequelPro of over 50,000 records and now when I go to view these records in my view (Laravel 4) I get General error: 1390 Prepared statement contains too many placeholders.</p>
  
  <p>The below index() method in my AdminNotesController.php file is what is generating the query and rendering the view.</p>
  
  <pre><code>public function index()
  {
      $created_at_value = Input::get('created_at_value');
      $note_types_value = Input::get('note_types_value');
      $contact_names_value = Input::get('contact_names_value');
      $user_names_value = Input::get('user_names_value');
      $account_managers_value = Input::get('account_managers_value');
  
      if (is_null($created_at_value)) $created_at_value = DB::table('notes')-&gt;lists('created_at');
      if (is_null($note_types_value)) $note_types_value = DB::table('note_types')-&gt;lists('type');
      if (is_null($contact_names_value)) $contact_names_value = DB::table('contacts')-&gt;select(DB::raw('CONCAT(first_name," ",last_name) as cname'))-&gt;lists('cname');
      if (is_null($user_names_value)) $user_names_value = DB::table('users')-&gt;select(DB::raw('CONCAT(first_name," ",last_name) as uname'))-&gt;lists('uname');
  
      // In the view, there is a dropdown box, that allows the user to select the amount of records to show per page. Retrieve that value or set a default.
      $perPage = Input::get('perPage', 10);
  
      // This code retrieves the order from the session that has been selected by the user by clicking on a table column title. The value is placed in the session via the getOrder() method and is used later in the Eloquent query and joins.
      $order = Session::get('account.order', 'company_name.asc');
      $order = explode('.', $order);
  
      $notes_query = Note::leftJoin('note_types', 'note_types.id', '=', 'notes.note_type_id')
          -&gt;leftJoin('users', 'users.id', '=', 'notes.user_id')
          -&gt;leftJoin('contacts', 'contacts.id', '=', 'notes.contact_id')
          -&gt;orderBy($order[0], $order[1])
          -&gt;select(array('notes.*', DB::raw('notes.id as nid')));
  
      if (!empty($created_at_value)) $notes_query = $notes_query-&gt;whereIn('notes.created_at', $created_at_value);
  
      $notes = $notes_query-&gt;whereIn('note_types.type', $note_types_value)
          -&gt;whereIn(DB::raw('CONCAT(contacts.first_name," ",contacts.last_name)'), $contact_names_value)
          -&gt;whereIn(DB::raw('CONCAT(users.first_name," ",users.last_name)'), $user_names_value)
          -&gt;paginate($perPage)-&gt;appends(array('created_at_value' =&gt; Input::get('created_at_value'), 'note_types_value' =&gt; Input::get('note_types_value'), 'contact_names_value' =&gt; Input::get('contact_names_value'), 'user_names_value' =&gt; Input::get('user_names_value')));
  
      $notes_trash = Note::onlyTrashed()
          -&gt;leftJoin('note_types', 'note_types.id', '=', 'notes.note_type_id')
          -&gt;leftJoin('users', 'users.id', '=', 'notes.user_id')
          -&gt;leftJoin('contacts', 'contacts.id', '=', 'notes.contact_id')
          -&gt;orderBy($order[0], $order[1])
          -&gt;select(array('notes.*', DB::raw('notes.id as nid')))
          -&gt;get();
  
      $this-&gt;layout-&gt;content = View::make('admin.notes.index', array(
          'notes'             =&gt; $notes,
          'created_at'        =&gt; DB::table('notes')-&gt;lists('created_at', 'created_at'),
          'note_types'        =&gt; DB::table('note_types')-&gt;lists('type', 'type'),
          'contacts'          =&gt; DB::table('contacts')-&gt;select(DB::raw('CONCAT(first_name," ",last_name) as cname'))-&gt;lists('cname', 'cname'),
          'accounts'          =&gt; Account::lists('company_name', 'company_name'),
          'users'             =&gt; DB::table('users')-&gt;select(DB::raw('CONCAT(first_name," ",last_name) as uname'))-&gt;lists('uname', 'uname'),
          'notes_trash'       =&gt; $notes_trash,
          'perPage'           =&gt; $perPage
      ));
  }
  </code></pre>
  
  <p>Any advice would be appreciated. Thanks.</p>