Sure thing.
<?php
//connect to MySQL
$connect = mysql_connect('localhost', 'xxx', 'xxx'
or die(mysql_error());
mysql_select_db('xxx')
or die (mysql_error());
//select tags for movie
$query = 'SELECT * FROM tags WHERE name = "enchanted"';
$result = mysql_query($query, $connect)
or die(mysql_error());
while ($nt=mysql_fetch_array($result))
{
echo '<a href=\"tags.php?id='. $nt['id'] .' ">'.$nt['tags'].'</a>';
}
?>
//for the user to insert a new tag into the database
<form action="insert.php" method="post">
Tag: <input type="text" name="name" />
<input type="submit" />
</form>
I tried another bit of code that I found on the forum, but I messed it up.
What I'm unsure about is when the user clicks the tag - I'm guessing it needs to open a new php page? If so, what should be in that page? How do I do it so taht page knows what to retrieve (in this case, all items that have the same tag?)
Many thanks