List:MySQL++« Previous MessageNext Message »
From:Warren Young Date:April 28 2009 10:51pm
Subject:Re: Strange MySQL++ Behaviour
View as plain text  
On Apr 27, 2009, at 3:21 PM, Ruben Lihet wrote:

> q << "INSERT INTO Sessions (link_id, remote_ip) VALUES (90,  
> '')";
>  q.execute();

Are you checking for exceptions?

>  cerr << q.error()

You're missing a semicolon, and maybe an "endl".

Also, if you're not using MySQL++ 3.0 or newer, you're missing a call  
to Query::reset().  (3.0 and up auto-reset the query object in many  
more situations, including the one you show above.)

> the "enndd"
> gets written into the database.

I don't see how.  If it were simply appended to your previous query,  
it would be bad SQL, so the query should be rejected.

Can you distill your code down to something that works with the MySQL+ 
+ example database to show the problem?  If others can't execute your  
program to see it for themselves, they're going to find helping you  
much more difficult.
Strange MySQL++ BehaviourRuben Lihet27 Apr
  • Re: Strange MySQL++ BehaviourWarren Young29 Apr