Array
(
[1] => Array
(
[content] => Приветствую!
[author] => Array
(
[username] => username
)
[attachments] => Array
(
[0] => Array
(
[url] => url
)
)
[timestamp] => 2021-10-05T20:12:09.162000+00:00
)
[2] => Array
(
[content] => Приветствую!
[author] => Array
(
[username] => username
)
[attachments] => Array
(
[0] => Array
(
[url] => url
)
)
[timestamp] => 2021-10-05T20:12:09.162000+00:00
)
)
$pdo = new PDO ( "mysql:host=$dbHost;dbname=$dbName;charset=utf8", $dbUser, $dbPassword );
$stmt = $pdo->prepare('INSERT INTO ТАБЛИЦА ( content, author ) VALUE ( :content, :author )');
foreach ($result as $msg ) {
$stmt->bindValue(':content', $msg["content"]);
$stmt->bindValue(':author', $msg["author"]["username"]);
$result = $stmt->execute();
}