Sql syntax
Hey guys
I want to insert values into a MySql database. The following line works fine: 1 Code:
mysql_query(connection, "INSERT INTO main (NumofShows , Title) VALUES('12', 'Home')"); Code:
string NewTitle = "Monaco"; How do i edit my sql statements so variables can be inserted into the Values ( ) , and it will be able to read the variables and then store it into the database. |
Hi gregarion,
In which language do you program? PHP, Perl, C, etc... In case of PHP do this: Code:
$NewTitle = "Monaco"; If you use another language please let us know. Angel. |
You either need to snprintf them into the string or concatenate a new string, e.g. with std::string += (assuming this is C++.)
Kevin Barry |
Hey , i am using C++.
SOrry Ta0kira, could u show me an example of how to do it using my example? |
Code:
#include <string> |
All times are GMT -5. The time now is 02:54 PM. |