Sorry... $uri->get('uid') is correct. Damn auto correction...
I've solved it. For everyone else:
If there's a parameter in the url and you save your site / form view, the parameter gets lost. Like:
www.mysite.com/myform?uid=15 ** save ** => www.mysite.com/thankyou
In the second url, the parameter sin't still there. When a dynamic field tries to get the parameter that doesn't exist, MySQL gets a request like "SELECT ... WHERE id = AND ...;" which is an error. To avoid this, you have to put in quotes around the call like id='$uri->get("uid")'. The MySQL request is now "SELECT ... WHERE id =' ' AND ...;". This is not an error.
Still the parameter isn't passed to the database, because the saving process seems to try to grab the gone away parameter.
To solve that I use my dynamic field to grab the parameter without saving. Then I add an input field with behavior "When mydynamicfield is filled, take its value".
Now it finally works. Would be much easier if you could just get the url parameter into live values...