Member-only story

PHP — P87: MySQL Insert Multiple Records with Prepared Statements

Dino Cajic
4 min readNov 3, 2022
Dino Cajic on MySQL Inserting Multiple Items with Prepared Statements

You may notice a small buildup between articles, and that’s intentional. No reason to overwhelm or dilute the topic. In this article, we’ll answer one additional question related to inserting data with prepared statements: do you need to keep binding variables for each set of data that you’re inserting?

View this article and others on my website.

Let’s just spoil that response: you don’t. Setup the binding once, change the variables, and execute. It may look a little strange, but as long as you know the flow, it will work.

Recap

--

--

Dino Cajic
Dino Cajic

Written by Dino Cajic

Author of An Illustrative Introduction to Algorithms. IT Leader with a B.S. in Computer Science, a minor in Biology, and a passion for learning.

No responses yet