I need to write a char * into my Mysql's table. But my char * has some char(0).
Here is my sample :
--------------------------------------
// Chaine = "Toto Titi "
char chaine[100];
chaine[0]=0x54; // Char T
chaine[1]=0x6F; // Chat o
chaine[2]=0x74; // Char t
chaine[3]=0x6F; // Char o
chaine[4]=0x00;
chaine[5]=0x54; // Char T
chaine[6]=0x69; // Char i
chaine[7]=0x74; // Char t
chaine[8]=0x69; // Char i
chaine[9]=0x00;
sprintf(requetesql,"UPDATE Table SET description='%s' WHERE id='1'",chaine);
mysql_query(idmysql,requetesql);
--------------------------------------
The Update works. But in the the Description field into my table, there are only Toto.
I think that the function Update write the string and stop to the first 0.
In another function as send or fwrite, we can specify the length of the string.