title: PHP: Create dynamic hyperlink from MySQL database
body: <p>I'm very new to PHP &amp; MySQL databases and was wondering how to create a random hyperlink in the text content pulled from the database. </p>
  
  <p>It's a blog type website and I would like to make certain words in the paragraph refer to different websites: is that possible?</p>
  
  <p>I know I can do something like this: </p>
  
  <pre><code>&lt;?php
  $sql = mysql_query("SELECT * FROM testblog ORDER BY id DESC");
  while($row = mysql_fetch_assoc($sql)) {
  $content = $row['content'];
  $href = $row['href'];
  ?&gt;
      &lt;p&gt; &lt;a href="&lt;?php echo $href; ?&gt;"&gt; &lt;?php echo $content; ?&gt; &lt;/a&gt; &lt;/p&gt;
  </code></pre>
  
  <p>The issue with the above format is that the whole paragraph is a hyperlink whereas I prefer individual words and sometimes I may not even need to refer to a website.</p>
  
  <p>Any help or simply pointing me in the right direct will be greatly appreciated, thanks!</p>