I am connecting to a SQLite database. I use the following query to get the results:
$db = new SQLite3('sshTunnel.sqlite');
$results = $db->query('SELECT * FROM TUNNEL');
Now, I want to add tabs and line breaks from the row array using file_put_contents
in PHP:
while ($row = $results->fetchArray(SQLITE3_ASSOC))
{
file_put_contents($file, $row, FILE_APPEND).PHP_EOL;
}
The results are displayed unformatted in one line:
TestTestTest Test Test Test
I wish to have this structure:
Test Test Test
Test Test Test
Where is the mistake?