I have a piece of code and i'm trying to modify it to list the URLs more seo friendly.

Currently the URLs are displayed like this :

/view/3456/keyword.html , is posible to display the URLs as /view/keyword.html without the ID number ?

PHP Code:
<?

$sql 
mysql_query("SELECT * FROM my_data WHERE published=1 ORDER BY id desc LIMIT 10");
    while(
$row mysql_fetch_array($sql))
    {
        
$abcd$row['name'];
        
$abcd str_replace (" ""-"$abcd);
            
            if (
$seo_on == 0
            {
                
$url 'index.php?task=view&id='.$row['id'].'';
            }
            else 
            {
                
$url 'view/'.$row['id'].'/'.$abcd.'.html';
            }
        
        echo 
'&nbsp;<a href="'.$site_url.'/'.$url.'">'.$row['name'].'</a><br>';
    }
?>
Or i need to modify something else to make it work because if i type www.domain/view/keyword.html i see page not found.