Overview
Features
Download
Documentation
Community
Add-Ons & Services

[SOLVED] MySQL do not affect the database

Please post support and help requests here.

[SOLVED] MySQL do not affect the database

Postby toffyrn » 14 Dec 2013, 01:09

Hi. I have installed libpocomysql (1.3.6p1-1ubuntu3_amd64.deb) on my linux server.

Using the attached code I can connect to MySQL without any C++ exceptions. Poco reports that the session is connected. The only problem is that viewing my database in phpmyadmin reveals the table is NOT created.

How can I proceed in debugging this issue?

Code: Select all
using namespace Poco::Data;
const std::string connString = "user=home-1312;password=something;db=home-1312;compress=false";
MySQL::Connector::registerConnector();
Session session(MySQL::Connector::KEY, connString);
if (session.isConnected())
{
   session << "CREATE TABLE Dummy (data INTEGER(10))", now;
   logger.trace(Poco::format("== %s == Session is connected to MySQL.", dateTimeString));
}
else
{
   logger.error(Poco::format("== %s == Session is not connected to MySQL.", dateTimeString));
}
Last edited by toffyrn on 18 Dec 2013, 22:27, edited 1 time in total.
toffyrn
 
Posts: 2
Joined: 14 Dec 2013, 00:59

Re: MySQL do not affect the database

Postby gregee123 » 16 Dec 2013, 14:44

Just a guess to be honest but can you try 'Poco::Data::Keywords::now' instead of 'now' ?

Code: Select all
session << "CREATE TABLE Dummy (data INTEGER(10))", Poco::Data::Keywords::now;
currently using: 1.5.4
gregee123
 
Posts: 54
Joined: 29 Mar 2013, 12:11

Re: [SOLVED] MySQL do not affect the database

Postby toffyrn » 18 Dec 2013, 22:31

Your guess pointed me in the right direction.

My problem was that "now" was declared as a variable of type "Poco::DateTime", and apparently this variable was used instead. Switched the date time to "dateTimeNow", and everything works like a charm.

Thank you so much!
toffyrn
 
Posts: 2
Joined: 14 Dec 2013, 00:59


Return to Support

Who is online

Users browsing this forum: No registered users and 4 guests

cron