Gsql prepared statements

Audit list
 - [ ] GSQLBackend
 - [ ] SSql
 - [x] gMySQL
 - [ ] gPgSQL
 - [ ] gSqlite3
 - [ ] gOracle
 - [ ] BIND (dnssec)
 - [ ] mydns
Instead of one if for each query, you can do just one if for all queries:

string domainIdQuery = "select origin, minimum from `"+soatable+"` where id = ?";
string domainNoIdQuery = "select id, origin, minimum from `"+soatable+"` where origin = ?";
string soaQuery = "select id, mbox, serial, ns, refresh, retry, expire, minimum, ttl from `"+soatable+"` where origin = ?";
if (!soawhere.empty()) {
     domainIdQuery += " and " + soawhere; 
     domainNoIdQuery += " and " + soawhere;
     soaQuery += " and "+soawhere;
}
d_domainIdQuery_stmt = d_db->prepare(domainIdQuery, 1);
d_domainNoIdQuery_stmt = d_db->prepare(domainNoIdQuery, 1);
d_soaQuery_stmt = d_db->prepare(soaQuery, 1);

Same thing to rrwhere