'How do I check if a mysql row result is empty?
How do I check to see if the mysql row results are empty in c++?
The following code I have doesn't work properly.
I am wanting to check to see if a row with the license key, and an empty field called HWID, and if the license key code is there, and the hwid isn't there, I want to enter a hwid value into the hwid field. Basically I was wondering if my code for checking if the query results are valid or not.
if (hwid == row[i])
{
return true;
}
else if((row[i] == NULL) || row[i] == "")
{
int qstate2 = 0;
stringstream ss;
ss << "INSERT INTO eNVYCSGO (HWID) VALUES ('" + hwid + "') WHERE licenseKey='" + licenseKey + "' LIMIT 1";
string query2 = ss.str();
const char* q = query2.c_str();
qstate2 = mysql_query(conn, q);
if (qstate == 0)
{
}
else
{
}
return true;
}
I tried the code above, and it doesn't enter the user's hwid(hardware ID) in that spot. Thats the purpose of these few lines of code.
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|
