what happens?
from a basic look, the value $num will always be unset, or equal the default zero whenevery you call the function, because you haven't passed it in.
The link will give the page whatever value $num is set to in GET method. Depending on your PHP settings, you will need to access it like: $_GET['num'];
I suggest changing the function signature to:
function showData($num = 0)
and then deleting that first if statement.
When you call the function, do so like this:
showData($_GET['num']);