0

My initial code:

std::string query = "SELECT login,passw FROM people WHERE login = '" + slovo + "'";
const char* q = query.c_str();
qstate = mysql_query(conn, q);
res = mysql_store_result(conn);

I need to use the data (login, password) to get a string in the database. If the string exists, then.... otherwise.... Tell me how to get a string for 2 variables and how to write a condition.

2
  • 2
    Avoid to construct SQL query by string concatenation, use binding variables instead. (See Exploits of Mom) Commented Aug 6, 2021 at 12:50
  • While it doesn't seem to me that the duplicate is correct (OP is not asking about prepared statements!), I do not understand what OP is asking about :) Commented Aug 6, 2021 at 13:12

0

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.