Insert a multidimensional array with MySQLI Prepared Statements?
source link: https://www.codesd.com/item/insert-a-multidimensional-array-with-mysqli-prepared-statements.html
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.
Insert a multidimensional array with MySQLI Prepared Statements?
Ive researched a lot on how to insert a multidimensional array into MySQL using mysqli prepared statements. The old way looked like this:
This would build a long query with all the values. How do i replicate this but in mysqli prepared statements?, ive found so many contradicting posts regarding this, anyone who can show a working example if possible?
Thanks a lot in advance.
foreach ($reg as $row){
$query = "INSERT INTO region (a1, b1, c1) values('$row[0]','$row[1]','$row[2]',)"; $result = mysqli_query($main, $query);
Related Articles
inserting a multidimensional array into mysql
Iterate Multidimensional Array with Nested Foreach Statement
fail without error with mysqli prepare statement
inner join will not work with mysqli prepared statement in php
PHP & amp; MySQL: Prepared statements vs function for security and coding speed
How to extract everything in assoc array from a prepared statement?
MySQL, MySQLi, MySQL Prepared Statement or DOP?
php mysqli prepared statement using wildcards
How can I assign a variable with a prepared statement in a stored procedure?
PHP mysqli prepared statement deleted zero
How does php / mysqli (prepared statements + bind params) protect against SQL Injection?
Sort the multidimensional array with qsort in C
Initialization of multidimensional arrays with loop enhancement in java
Table difference for a multidimensional array with a single array in php
Recommend
About Joyk
Aggregate valuable and interesting links.
Joyk means Joy of geeK