Im unsure how you are handling the "edit" action trigger.
From the code you have posted it looks like you need an anchor similar to this:
<a href=?edit=true&aid=xxxxx&uid=xxxxx>Edit</a>
But, you have not posted any code that generates such HTML.
So, im guessing you are using a button to edit a record. In which case you will need two hidden INPUT fields to pass the "aid" and "uid". ie:
<input type=hidden name=aid value=xxxx>
<input type=hidden name=uid value=xxxx>
But, you haven't posted such code either.
Anyway, normally the "uid" or user id, comes from a $_SESSION variable so its hidden from the user and not editable. Having it as a URL parameter or hidden INPUT field will enable hackers to fake user ids.
But, anyway. Thats all I can see. You need to work out how you are to submit a "aid" variable so that it actually appears in $_REQUEST[aid]