Hi! Could we please enable some services and cookies to improve your experience and our website?

PHPize Online / SQLize Online  /  SQLtest Online

A A A
Login    Share code      Blog   FAQ

Online Sandbox for SQL and PHP: Write, Run, Test, and Share SQL Queries and PHP Code

Copy Format Clear

Stuck with a problem? Got Error? Ask AI support!

Copy Clear
Copy Format Clear
<?php $array = [ '098A', 'mike', 'Street17', 'LA', '07AA', 'steve', 'Street14', 'LA' ]; $stmt = $mysqli->prepare('INSERT INTO my_table (col1, col2, col3, col4) VALUES (?,?,?,?)'); foreach (array_chunk($array, 4) as $row) { $stmt->execute($row); } var_export( $mysqli->query('SELECT * FROM my_table')->fetch_all(MYSQLI_ASSOC) );
Copy Clear