First post so hi everyone first of all!
Im in need of some help…
I have a menu that I’ve setup to dynamically create links from my database (mysql)
<?php
mysql_connect("********","*********","**********") or die(mysql_error());
mysql_select_db("watch") or die(mysql_error());
$query = mysql_query("SELECT * FROM watch ORDER BY time")
or die(mysql_error());
while($row = mysql_fetch_array( $query )) {
{
$id = $_GET['id'];
}
echo "<div class=\\"collapsed\\"> <span class=\\"rss:item\\">";
echo $row['time'];
echo " - ";
echo $row['match'];
echo "</span>";
if($row['1']) echo "<a href=\\"http://www.site.com/folder/1/{$row['id']}.html\\" target=_blank>Link 1</a>"; else echo "" ;
echo "</div>";
}
?>
now what I’d like to do is add the title of the page into the URL like:
Question is, I’m somewhat of a php noob and struggling to implement it, I cant work out where to put the code, how to make the title all lowercase for the URL, and add a “-” instead of a space…
Can anyone help me out at all?
Ive read that it can be done via .htaccess or both, but apparently the best way is php…?