On Wednesday 04 December 2002 16:29, Tom Roos wrote:
> hi
>
> does this function handle a binary string of any length or is there some
> sort of max limit.
>
> when i load a binary file (filesize 49Kb) into a blob field, the function
> is ok but when the filesize is 1.8Mb, the function fails and my programs
> aborts. using the debugger, the program aborts when in this function.
>
> if mysql_real_escape_string() has a max limit, how does one get around
> this? could it be set in my.cnf, or somewhere else? or is this a case of
> bad practise to load big (> 1Mb) into mysql?
>
> tks
> tom
>

Hi,

mysql_real_escape_string uses 4 parameters: MYSQL *mysql, char *to, char 
*from, ulong length)

*to should be allocated from your program, and the size should be 2 * 
strlen(from) + 1, which is the worst case (every char has to be escaped). If 
length is < 2 * strlen(from) + 1 you can change the size via realloc.

Regards

Georg


Filter:mysql,query

---------------------------------------------------------------------
Before posting, please check:
   http://www.mysql.com/manual.php   (the manual)
   http://lists.mysql.com/           (the list archive)

To request this thread, e-mail <[EMAIL PROTECTED]>
To unsubscribe, e-mail <[EMAIL PROTECTED]>
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php

Reply via email to