title: Need to return/echo PHP PDO results from database
body: <p>Well I've did do my research and I just can't seem to figure this out. So long story short, I'm using something like this:</p>
  
  <p>btw, "(WebsiteInfo)" is just to sensor out my website/database information.</p>
  
  <pre><code>$SQL = new PDO('mysql:dbname=(WebsiteInfo);host=(WebsiteInfo);charset=utf8', '(WebsiteInfo)', '(WebsiteInfo)');
  
  $SQL -&gt; setAttribute(PDO::ATTR_EMULATE_PREPARES, false);
  
  $SQL -&gt; setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);
  </code></pre>
  
  <p>Now, that's just currently just to start the database connect up. Which btw is mostly just a copy/paste code I found on this website too which is to prevent MySQL injection. Actually from this link <a href="https://stackoverflow.com/questions/60174/how-to-prevent-sql-injection-in-php">How can I prevent SQL injection in PHP?</a>. If there's anything wrong with it, I wouldn't mind advice or tips. As long as if it makes sense because I just started using databases probably not even a week ago so everything is new to me. Now there's this:</p>
  
  <pre><code>$Exicu = $SQL -&gt; prepare("SELECT `tags` FROM `users` WHERE `user_id` = :a ") -&gt; execute(array( ':a' =&gt; 16));
  </code></pre>
  
  <p><code>$Exicu</code> is just there, because I have been trying to get the results from the query (if I said that right). Also the 16 is the users ID, but this will change often so that's why 16 isn't just tossed in the prepare statement. I've tried a lot of things but none of them worked. It either didn't work or made the PHP crash.</p>
  
  <p>But anyway, things I already tried for <code>$Exicu</code> is <code>$Exicu-&gt;rowCount()</code>, <code>$Exicu-&gt;bindParam</code>, a while loop with <code>$row = $Exicu-&gt;fetch()</code>, <code>$SQL-&gt;query($Exicu)-&gt;fetchAll();</code>, a <code>foreach</code> loop with <code>($Exicu-&gt;fetch(PDO::FETCH_ASSOC) as $row)</code>, <code>$Exicu-&gt;get_result()</code>, <code>echo PDO::query($Exicu);</code>, <code>echo mysql_result($Exicu)</code>, and just <code>echo $Exicu</code>. Yes I know, that looks pretty sloppy.</p>
  
  <p>But none of these seemed to work to just show me the <code>tags</code> from the database of the specific user. So that's pretty much what I need help with. There's no problem when I use something like this <code>echo mysql_result( mysql_query("SELECT (etc,etc)") )</code> but that doesn't have protection from MySQL injections.</p>