Hey guys, i am having a problem in my query statement. I am using Mysql in Netbeans and c++.
What i am trying to do is for the user to enter a certain value and then the program will store the value into the database...
string NewMovie ;
Cout <<" Enter your new movie : " << endl ;
cin << NewMovie ;
Basically, the person will enter a new movie(in this case Avatar) and the input will be saved to a string called NewMovie.
Here is when my problem starts...How do i input this variable into an insert sql statement. I check my statement and i tried hardcoding my data like this...
mysql_query(conn,"INSERT INTO movie_info (movie_title , values ('Avatar')" );
The database will be updated. But if im using a variable called NewMovie, what can i do for it to be able to be read by the query?
I read up Cstring and ostreamstring but i do not get how they are used. Could sombody show me using the the example i gave above how i can solve my problem.