On 9/22/06, AJ <[EMAIL PROTECTED]> wrote:
I hackish method might be something like this:
struct s
{
...
};
struct s myS;
char buf[sizeof(s)*2]; // *2 as base64 encoding will be approx 33% bigger.
base64_encode( &myS, buf, sizeof(s) );
INSERT INTO table ( myTextField ) VALUES ( 'buf' );
then retrieval is the opposite.
Beware however that for this to work you must read and write from
machines with the same endian order, otherwise you'll end up with
corrupted data in your structure (for example intel/AMD processors are
little endian while powerPC processors are big endian). Also beware
about the 32/64 bits.
Vivien
-----------------------------------------------------------------------------
To unsubscribe, send email to [EMAIL PROTECTED]
-----------------------------------------------------------------------------