You didn't happen to notice those are two different pages did you? at least in googles eyes they are.
I explain how this all works in detail in my book, but basically changing query parameters on a URL is enough to make the URL unique in AdSense's eyes and the crawler to come crawling again. And any keywords in the URL, including the query parameters, are important clues to AdSense about the content of the page. This is why when configuring AdSense-friendly WordPress blogs you want to turn on the option to use the blog entry's title in the URL of the posting. Take a few moments and read how bloggers can get relevant AdSense ads and my series on making WordPress blogs AdSense-friendly.
Yes, I have used this technique before couple of months ago but you really can not change the ads displayed right away and it takes time. By that time Google adsense bot already picks up what your site/content is about. This technique especially helps when you have flash, embedded content on your site such as flash games. If the site is new adsense starts showing programming/flash related ads right away and this code may help.