How to check if result of request to DB is empty?

Suliman via Digitalmars-d-learn digitalmars-d-learn at
Fri Dec 11 13:05:25 PST 2015

I am using

string query_string = (`SELECT user, password FROM otest.myusers 
where user LIKE ` ~ `'%` ~ request["username"].to!string ~ `%';`);
         auto rs = db.stmt.executeQuery(query_string);

         string dbpassword;
         string dbuser;

         while (
             dbuser = rs.getString(1);
             dbpassword = rs.getString(2);
             writeln("Place seems unreachable"); // if SQL result 
is empty

How I can check if SQL request returned empty result?

More information about the Digitalmars-d-learn mailing list