There is some data array:

array('number'=>'one', 'time'=>'seven', 'fruit'=>'apple')

Key names are not known in advance. There is also a table with such columns:

hash|time|key|val

Hashh is some identifier by which you can select all values ​​of a given array. How one request to "insert" an array into the database?

    1 answer 1

     $myArray = [ ваши пары значений]; $db = new mysqli(данные для коннекта); $stmt = $db->prepare('INSERT INTO table (hash, key, val) VALUES (?,?,?)'; foreach($myArray as $key => $value){ $hash = вычисляем нужный хэш; $stmt->bind_params('sss', $hash, $key, $value); $stmt->execute(); } $stmt->close(); $db->close(); 

    the request is not one, but "prepared", i.e. will work fast enough.

    upd besides, it is extremely dangerous to insert an array of a previously unknown size in one operation. You can run into the physical impossibility of the database server to digest a very large query.