Hi, I wanted to read and write a C++ structure to the DB. I went
through the example given and from this sinppet of code I got from the
user mannual, had a small Q.
I thought that std::string is a /0 delimited string, if so, how does
this work? If the binary data has a /0 inbetween somwhere in there,
wouldnt the string fill be shortened when pushed into the strbuf?
ostringstream strbuf;
char *read_buffer = new char[blen];
In.read(read_buffer, blen);
string fill(read_buffer, blen);
strbuf << "INSERT INTO " << MY_TABLE << " (" << MY_FIELD <<
")
VALUES(\"" << mysqlpp::escape << fill << "\")" << ends;
Thanks
Ankur