Though if the expectation is that only one result would come back then could modify the above to not loop.

Problem is, which no one has commented on, with ZC 1.5.3 and beyond, database functions require mysqli_ type functions. That said, when using zc, should use zc. Related functions so that version differences are minimal and "easy" to address. If you said you were using ZC 1.5.5 I would have suggested the loop to work differently.
Thanks for the help mc12345678!!