VVM Ravikumar Sarma Chengalvala writes:
> Hi Sinisa,
> Thanks for the detailed mail.Can you send me the
> syntax for mysql_escape_string() please so that I can
> check up with what I have been trying out.
>
> Regards,
> Ravi
Here is an example from C++ :
char* s = new char[in.size()*2+1];
mysql_escape_string(s, const_cast<char *>(in.c_str()), in.size() );
Actually, it is quite simple :
unsigned long mysql_escape_string(char *to,const char *from, unsigned long
from_length);
You pass to char array of at least 2 * from_length + 1 bytes. You pass
original char array as a second parameter and it's total length as a third
parameter.
The above function returns a new length of `to' char array.
Regards,
Sinisa
____ __ _____ _____ ___ == MySQL AB
/*/\*\/\*\ /*/ \*\ /*/ \*\ |*| Sinisa Milivojevic
/*/ /*/ /*/ \*\_ |*| |*||*| mailto:[EMAIL PROTECTED]
/*/ /*/ /*/\*\/*/ \*\|*| |*||*| Larnaca, Cyprus
/*/ /*/ /*/\*\_/*/ \*\_/*/ |*|____
^^^^^^^^^^^^/*/^^^^^^^^^^^\*\^^^^^^^^^^^
/*/ \*\ Developers Team
.
---------------------------------------------------------------------
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