Wordpress query_post question

Hello forums,

Im kinda stuck with my function. Im tryng to query post on certain categies but it just displays the lates entries

function footLink($cat){
if ( have_posts() ) : while ( have_posts() ) : the_post();
<li><a href="<? the_permalink()?>"><? the_title(); ?></a></li>
endwhile; endif;   
echo footLink(12);

this one just displays the recent entries and not posts from the category id 12

Any idea why?


it should be query_posts(β€˜cat=’.$cat.β€˜β€™);