I met a problem when i wanna insert binary to database. I've spent a lot of time to solve it but i still cannot find any solution......
My problem is, when i insert binary by binding it to statement and execute the query. The steps report no error. However, only NULL is inserted to database. (if i set the column to Not-NULL, 0 is inserted instead)\
Here is my work flow:
sprintf_s(query, 2048, "INSERT INTO Person(Name) VALUES(?)");
if (mysql_stmt_prepare(stmt, query, strlen(query)))
memset(bind, 0, sizeof(bind));
unsigned long size = strlen(personName);
bind.buffer_type = MYSQL_TYPE_VAR_STRING;
bind.buffer = (char *)personName;
bind.length = &size;
bind.is_null = (my_bool*)0;
if (mysql_stmt_bind_param(stmt, bind))
Have anyone met something like this?? Any suggestion is appreciated!!