title: PHP Creating a tag system for website
body: <p>I'm creating a tag system for website with PHP. I created 3 tables: one for Articles (table name:article, rows: id, title, alias), one for Tags (name:tag_content, rows:id, name, link) and one for assign tag for articles (name: tag_art, rows: id_tag, id_arty; for example: 4 articles, with different id, all with one id_tag equal 2). All scripts are done, so I can add the Articles, Tags, and assign Tags to Articles. I have also written a script for display the result-link:</p>
  
  <pre><code>$zmienna = "SELECT name, link FROM tag_content";
  $result2 = mysql_query($zmienna);
  echo $result2;
  while($row=mysql_fetch_array($result2)){
      echo "&lt;a href='http://www.somelink.xx/tag/".$row['link']."'&gt;".$row['name']."&lt;/a&gt;&lt;br&gt;";
  }
  </code></pre>
  
  <p>And it shows all created links(tags). 
  1. Now i want to take not every tags but random from the database and display them (so it should be more natural). How to do it?
  2. After clicking link/tag I want to display all articles with the same id_tag (assigned to one tag). How to do it?</p>
  
  <p>Thx for help. If I didn't put enought information (code etc.), let me know.</p>