Problem
Recently, I was working on a project where I was importing – using Laravel Excel – more than 200K users from the excel sheet, but all of a sudden I received the below error in the console.
Illuminate\Database\QueryException SQLSTATE[HY000]: General error: 1390 Prepared statement contains too many placeholders (SQL: insert into
Solution
It’s not the real solution but an instruction to use it wisely. There is a limit of 65,535 (2^16-1) placeholders in MySQL. So we have to be careful when creating the placeholder in prepared statements.
Did this post help you?
Tutsplanet brings in-depth and easy tutorials to understand even for beginners. This takes a considerable amount of work. If this post helps you, please consider supporting us as a token of appreciation:
- Just want to thank us? Buy us a Coffee
- May be another day? Shop on Amazon using our links.
Your prices won't change but we get a small commission.