I am creating a Reservation DB and C++ program and have caught a snag. I am using Linux, MySQL, MySQL++, and C++ for developing this program. I am having trouble executing a command.
I want to run the query that looks like this
mysql_query(con,"SELECT * FROM RESERVATIONS WHERE STATUS = 'EnterStatus'");
EnterStatus is a variable that accepts the value from a user input on a basic cin line.
This query returns me 0 results if I were to type in confirmed for EnterStatus. However if I run the query as
mysql_query(con,"SELECT * FROM RESERVATIONS WHERE STATUS = \'confirmed\'");
This returns 5 results as it should. Am I not using correct syntax for passing a varaible into a query or am I just missing something?
Thanks all for your help!!!