PHP $_GET file not retrieving data from a mysql database <p>I have PHP scripts that are trying to read data from my mysql database. The first script called news.php reads data from some of the rows in my database and displays it in summary form. It also generates a unique hyperlink for each article that someone can click on and be taken to read the full article.</p> <p>This is the news.php that retrieves a summary from my database</p> <pre><code>&lt;?php // connection string constants define('DSN', 'mysql:dbname=mynewsdb;host=localhost'); define('USER', 'myadmin'); define('PASSWORD', 'pwd2015'); // pdo instance creation $pdo = new PDO(DSN, USER, PASSWORD); // query preparation $stmt = $pdo-&gt;query(" SELECT title, introtext, id, created, created_by, catid FROM mynews_items "); // fetching results $result = $stmt-&gt;fetchAll(PDO::FETCH_ASSOC); // if this returns 0 then it means no records are present echo count($result) . "\n"; // the loop should print valid table foreach ($result as $index =&gt; $row) { if ($index == 0) echo '&lt;table&gt;'; echo &lt;&lt;&lt;HTM &lt;tr&gt; &lt;td&gt; &lt;span class="post-date"&gt;{$row['created']}&lt;/span&gt; &lt;/td&gt; &lt;/tr&gt; &lt;tr&gt; &lt;td&gt; &lt;h2 class="blog-post-title"&gt;{$row['title']}&lt;/h2&gt; &lt;/td&gt; &lt;/tr&gt; &lt;tr&gt; &lt;td&gt; &lt;p&gt; {$row['introtext']} &lt;/p&gt; &lt;/td&gt; &lt;/tr&gt; &lt;tr&gt; &lt;td&gt; &lt;p&gt; &lt;a href='read.php?id={$row['id']}'&gt;&lt;input type="button" value="Read More" /&gt;&lt;/a&gt; &lt;/p&gt; &lt;/td&gt; &lt;/tr&gt; &lt;tr&gt; &lt;td&gt; &lt;div class="blog-meta"&gt; &lt;img src="img/avatar.png" alt="Avatar" /&gt; &lt;h4 class="blog-meta-author"&gt;{$row['created_by']}&lt;/h4&gt; &lt;span&gt;Category: {$row['catid']}&lt;/span&gt; &lt;/div&gt; &lt;/td&gt; &lt;/tr&gt; HTM; if ($index == (count($result)-1)) echo '&lt;/table&gt;'; } </code></pre> <p>When you click on the hyperlink generated by <code>&lt;a href='read.php?id={$row['id']}'&gt;&lt;input type="button" value="Read More" /&gt;&lt;/a&gt;</code> the read.php script should retrieve and show the full article from my database. The field storing the articles is named <code>fulltext</code></p> <p>This is the read.php file</p> <pre><code> &lt;?php // connection string constants define('DSN', 'mysql:dbname=mynewsdb;host=localhost'); define('USER', 'myadmin'); define('PASSWORD', 'pwd2015'); // pdo instance creation $pdo = new PDO(DSN, USER, PASSWORD); // query preparation $stmt = $pdo-&gt;query(" SELECT fulltext FROM mynews_items "); echo htmlspecialchars($_GET["fulltext"]); ?&gt; </code></pre> <p>Can someone point out the mistake I am making on my read.php file because it loads as a blank page without any data.</p> <p><strong>UPDATED read.php</strong> This is the updated file which is still returning a blank page. Can anyone point out any mistake?</p> <pre><code>&lt;?php $id = $_GET['id']; if(isset($_GET['id'])) // connection string constants define('DSN', 'mysql:dbname=mynewsdb;host=localhost'); define('USER', 'myadmin'); define('PASSWORD', 'pwd2015'); // pdo instance creation $pdo = new PDO(DSN, USER, PASSWORD); // query preparation // $stmt = $pdo-&gt;query("SELECT id, fulltext FROM fm16p_k2_items WHERE id='{$row['id']}'", PDO::FETCH_ASSOC); { $sql = mysql_query("SELECT fulltext * FROM fm16p_k2_items WHERE id = '{$id}'"); $row = mysql_fetch_object($sql); } echo $row-&gt;fulltext; ?&gt; </code></pre>