A blank page is usually the result of a syntax error in the php. A missing semi-colon can cause it. Did you use open and closing php tags? try removing those.
--------------- Added [DATE]1457708894[/DATE] at [TIME]1457708894[/TIME] ---------------
After re-reading your post and looking at the link you provided, I realized you're going about it the vb3/4 way. VB5 is totally different. Your best bet is to create a product and write your class to query the database, initial checks and return the results. Then call your api from the template code and use your if conditions there.
Checkout the
vB_dB_Assertor Class Reference docs.