Fixing SQL statement

This commit is contained in:
stephb9959
2022-04-25 07:46:39 -07:00
parent 981e845460
commit 40baf47011

View File

@@ -216,10 +216,10 @@ namespace OpenWifi {
std::string Query;
if(Prefix[0]=='*') {
Query = fmt::format(" operatorId={} and (right(serialNumber,{})='{}' or right(realMacAddress,{})='{}' ) ",
Query = fmt::format(" operatorId='{}' and (right(serialNumber,{})='{}' or right(realMacAddress,{})='{}' ) ",
operatorId, Prefix.size()-1, Prefix.substr(1), Prefix.size()-1, Prefix.substr(1));
} else {
Query = fmt::format(" operatorId={} and (left(serialNumber,{})='{}' or right(realMacAddress,{})='{}' ) ",
Query = fmt::format(" operatorId='{}' and (left(serialNumber,{})='{}' or right(realMacAddress,{})='{}' ) ",
operatorId, Prefix.size(), Prefix, Prefix.size(), Prefix);
}