hi pleas i need help if it's possible ; i have a c++ code which can select from a DB but i can't do the code for insert a new data in my data base .

7 Years
Discussion Span
Last Post by sana_moi

First you need to learn SQL. If you alreay have that down pat then just create the UPDATE string and send it to the DB like you do the SELECTs. From c++ perspective there is no difference between the two, its just that queries are a little more difficult than updates because you have to process the result sets from queries.

If you re having problems writing the UPDATE string then post what you have so that we can provide specific help. You basically have to expand the string to include the value of all variables, much like you do when displaying it on the console screen. std::stringstream class can help you out with that.

Edited by Ancient Dragon: n/a


if you can give me an exemple that will be a great cause i know that i have to use this reguest " insert into table() values ..." but how ?!! no idea

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.