Hey! I am making a program that keeps track of users so the program has to update the number in the database how do I actually do it? I know how to select things and such, but have no idea how the update works.. I didn't really find anything for c++ in google :S. Thanks in advance.
Silvershaft 2 Junior Poster
Recommended Answers
Jump to PostI got only one entry and one column in my table so would I do like this
stmt = con->createStatement(); res = stmt->executeQuery("UPDATE users SET usersactive = usersactive+1");
This isn't working.. What do I do wrong
Maybe this is finally missing:
res = stmt->executeQuery("COMMIT");
It's always …
Jump to PostPlease, submit the complete method where these both statement
>> stmt = con->createStatement();
>> res = stmt->executeQuery("UPDATE users SET usersactive = usersactive+1");be executed and the exception be thrown.
-- tesu
Jump to Postwell, if in
>> while(!IsKeyPressed(VK_ESCAPE) )
IsKeyPressed functions as I am supposing, then your exception is NOT thrown by an sql mistake but thrown by for example most likely heap/stack overflow because
>> stmt = con->createStatement();
>> res = stmt->executeQuery("SELECT isRedeemOn FROM isredeemon");will be executed …
Jump to Postsounds really strange.
btw, which line between line# 14 and 59 is actually responsible for this strange exception?
-- tesu
Jump to PostThe executequery where I do the update thing.
Ah sorry, I should have read your code more seriously. So the error happens there:
stmt = con->createStatement(); res = stmt->executeQuery("UPDATE users SET usersactive = '10' WHERE id='1'");
You redefine a prior stmt, what could lead to problems with …
All 22 Replies
Excizted 67 Posting Whiz
Silvershaft 2 Junior Poster
Excizted 67 Posting Whiz
Silvershaft 2 Junior Poster
Excizted 67 Posting Whiz
Silvershaft 2 Junior Poster
tesuji 135 Master Poster
Silvershaft 2 Junior Poster
Excizted 67 Posting Whiz
tesuji 135 Master Poster
Silvershaft 2 Junior Poster
tesuji 135 Master Poster
Silvershaft 2 Junior Poster
tesuji 135 Master Poster
Silvershaft 2 Junior Poster
tesuji 135 Master Poster
tesuji 135 Master Poster
Silvershaft 2 Junior Poster
tesuji 135 Master Poster
Silvershaft 2 Junior Poster
tesuji 135 Master Poster
Silvershaft 2 Junior Poster
Be a part of the DaniWeb community
We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.