while ($res = mysql_fetch_array($action)) {
$output = "<a href=\"product.php?id={$res['id']}\">{$res['product_name']}</a>";
echo $output;
}
or
while ($res = mysql_fetch_array($action)) {
$output = sprintf('<a href="product.php?id=%u">%s</a>', $res['id'], $res['product_name']);
echo $output;
}