+ 1
if(mysql_query(connection, "INSERT INTO MightyAccounts(Email, Password) VALUES (email, pass)") != Missing RHS operand for operator != I think you missed the single quotes to wrap data in your SQL string VALUES block. And I'm not sure C++ can insert parameter values into string. A lot of things are missing from this code.
24th Dec 2019, 10:26 AM
Ipang
+ 1
Let's go over that query first. You understand that string values in SQL query should be wrapped in single quotes right? And as I understand it, C++ string does not automatically replace a variable name in the string by the variable's value. So first we need to add single quotes around the values to insert. And then concatenate the <email> and <pass> argument as necessary. NOTE: I'm assuming your `Email` and `Password` field was that of a string compatible type (char, varchar etc.) std::string query = "INSERT INTO MightyAccounts(Email, Password) VALUES ('" + email + "','" + pass + "')"; Try to run this as query.
24th Dec 2019, 10:51 AM
Ipang
0
I'm afraid I can't help you with this one. At the moment I don't have access to a computer and I can't test this on SoloLearn (mysql.h not available here). I recommend to edit your most recent reply, to add error description and/or message. This is so others who reads it get more informed of the situation and given that, hopefully, can assist you in more appropriate way. May you find a solution 👍
25th Dec 2019, 5:53 AM
Ipang