PDA

View Full Version : Storing binary data in MySQL using C API



bluedalmatian
June 24th, 2007, 04:07 PM
Hi

Just wanted to clarify this, if I've got some binary data in a C char array which I want to store in MySQL using mysql_real_query

Is it OK to do it by simply concatenating the char array into the query string at the appropriate place and then passing the whole string to mysql_real_query

Thanks
Andrew

aks44
June 24th, 2007, 05:58 PM
If you escape your binary data beforehand (mysql_real_escape_string or something like that, I don't remember precisely) then it is ok.

bluedalmatian
June 24th, 2007, 09:11 PM
Thats great, thanks.