30 Nov
2012
30 Nov
'12
8 p.m.
On Fri, Nov 30, 2012 at 3:35 AM, Nitin Tomer <ntomer@newgen.co.in <mailto:ntomer@newgen.co.in>> wrote:
I want to execute the above query, and check whether any result came. If results came, then I want to proceed to next number. And if no result came, then I want to set it in the session variable and break from the while loop. But I could only find the syntax for assert, no way to check whether the query returned any result or not. Please help me out.____
This is how I do it: querystring="SELECT `name` FROM `table` WHERE `id`="..id.." dbh:query(querystring,function(row) result=row.name end) if result~=nil then -- do something with the result get end -- Mimiko desu.