PHP Code:
<?php
$rowcolor = 1;
$sql = "select wallpaperid, title from wallpaper where status = 'L' order by downloads desc limit 0,10";
$result = mysql_query($sql ,$db);
if ($myrow = mysql_fetch_array($result)) {
do {
if ($rowcolor == 1) {
$rowcolorhex = "light";
$rowcolor = 0;
} else {
$rowcolorhex = "dark";
$rowcolor = 1;
}
printf("<li class=%s><a href=http://domain.com/%s-%s.html>%s</a> ", $rowcolorhex, $myrow["wallpaperid"], $myrow["title"], $myrow["title"]);
} while ($myrow = mysql_fetch_array($result));
}
?>
This outputs:
Code:
<li><a href="http://domain.com/163-My Row Title.html">My Row Title
The problem is, I need it outputted like:
Code:
<li><a href="http://domain.com/163-my-row-title.html">My Row Title
163-My Row Title.html to
163-my-row-title.html
Don't suppose someone could help me out?