Php - Array to string conversion
<p>I want to output all records in my database. So far so good, but when I loop through it, php gives me an error " Array to string conversion ". </p>

<ul>
<li><p>I added an index to the array but then it does just output obviously the first or secound ( etc. ) column.</p>

<pre><code>$conn = new PDO("mysql:host=localhost;dbname=database","root","");
$stmt = $conn-&gt;prepare('SELECT * FROM de');
$stmt -&gt;execute();
$result = $stmt -&gt;fetchAll();

if (is_array($result) || is_object($result))
{
    foreach ($result[0] as $value)
        {
            echo "&lt;table&gt;&lt;tr&gt;&lt;td&gt;'$value'&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;";
        }
}
</code></pre></li>
</ul>

<p>So, with the index, it does work. But I need all records, not just one.</p>

<p>I appreciate every comment and help!</p>