There are two possible solutions:
- add a field to the issued-certificates-data-table and modify the module so it copies the license data into that field. Plus have the certificate.php display that field.
- add a select-command to your certificate.php, much like your second thought. You can use the field userid to identify the student.
I'm not sure if the AND-operator in your select-function is correct here. You should select "licensenumber" from "user_info_data" where userid=$certrecord->userid