I pass a char* (charData) containing my binary data into my insert routine
along with the size of the binary data. Then;
string blobData;
blobData.assign(charData, size);
mysqlpp::Query query = mySQLconn.query();
query << "insert into table (fieldname) values (";
query << ",\"" << mysqlpp::escape << blobData << "\")";
query.execute();
This may not be the most elegant use of mysqlpp, but it works.
On Nov 19, 2007 5:03 AM, António Santos <ansantos@stripped> wrote:
> Hi,
>
> I'm having some difficulties in inserting binary data to mysql.
> I have an array of bytes (unsigned char[]) and I want to insert those
> bytes into a table.
> How can I do that? The provided example doesn't help me that much
> because it uses binary data read from a file.
>
> Thanks,
>
> António Santos
>
>
>
> --
> MySQL++ Mailing List
> For list archives: http://lists.mysql.com/plusplus
> To unsubscribe:
> http://lists.mysql.com/plusplus?unsub=1
>
>