> On Sat, Dec 27, 2003 at 11:09:54AM -0500, Angus March wrote: > > > On Fri, Dec 26, 2003 at 09:35:42PM -0500, Angus March wrote: > > http://www.mysql.com/documentation/mysql/bychapter/manual_Clients.html#mysql_real_query > > > > The quote I'm thinking of is: > > > > You must use mysql_real_query() rather than mysql_query() for queries > > that > > > > contain binary data, because binary data may contain the `\0' character > > > >
[snip] > > http://www.mysql.com/documentation/mysql/bychapter/index.html#mysql_real_escape_string > > > > I didn't notice this function before. That and mysql_real_query() don't > > seem to be written with each other in mind. It even encodes the '\0', which > > mysql_real_query() is said to be able to deal w/. In fact, why should I need > > to use mysql_real_query() over mysql_query() if I use > > mysql_real_escape_string()? [snip] It seems there's a little more to it than this. Also like a character string, a character string-encoded blob has to be enclosed in single quotes. Early on I tried double quotes, then when that didn't work, I went through a very long process of trying long strings of decimal numbers, with varied result, many of which didn't generate an error even. When I finally hit on single quotes, it came together. I remember fighting for rather a long time w/SQL a few years ago over the single quote problem w/character strings, but that was different from blobs. I really wish the documentation I read was clearer about handling blobs. Well, thanks for putting me on the right track. -- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe: http://lists.mysql.com/[EMAIL PROTECTED]