From: Warren Young
Date: April 28 2009 10:51pm
Subject: Re: Strange MySQL++ Behaviour
List-Archive: http://lists.mysql.com/plusplus/8537
Message-Id: <70368C33-F3E5-4FDF-9D98-58CA9B864E23@etr-usa.com>
MIME-Version: 1.0 (Apple Message framework v930.3)
Content-Type: text/plain; charset=US-ASCII; format=flowed; delsp=yes
Content-Transfer-Encoding: 7bit
On Apr 27, 2009, at 3:21 PM, Ruben Lihet wrote:
> q << "INSERT INTO Sessions (link_id, remote_ip) VALUES (90,
> '127.8.8.1')";
> 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.