That would be correct if id were your key, but data is your key. getid will need to do a full traversal rather than a simple search, in which case r might be NULL several times before the correct node is found:
void MyBST::getid(treenode* r, int &stuid)
{
if (r != NULL) {
getid(r->left, stuid);
if (r->id == stuid)
cout<<"Found "<< r->id <<'\n';
getid(r->right, stuid);
}
}