Thanks for your help so far.
The database that I'm querying isn't the vB database which is why I used 'connect to database' - sorry I didn't make that clear.
I've just changed the hook location from member_start to member_complete and I'm happy to say it's working

I originally chose member_start because I thought that would get processed / executed before member_complete - thinking that member_complete might be used for 'end of page' things - may be a stupid assumption but I often do things through trial and error... often the best way to get your head around things when you don't really know what you're doing LOL. I tried doing some reading up yesterday on the different hook locations but the vB manual wasn't very informative.