Yes PHP can deal with unitialized variables, well in a sense anyway. You have to capture them.
There is a function called isset(var) wher var is your variable. It returns true if initialized of flase if not. There is much more info on it in the manual so you should look there to get a good idea of what it does.
basically as your code goes
if isset ($id){
//query the db
}
else{
//provide an erro message.
}
It is a good piece of code to ensure that query string variables have been correctly assigned.
David