Hi Sinisa,
Thanks for spending the time.Here are few observations
on mysql_escape_string().I have checked it up and
found to be working but with the following problems.
i)
It works well when I want to insert strings like:
"'xyz" or "x'yz".
ii)
When I use "x\yz" with the function I see a junk
character appearing like "x(junt char)yz" in mysql
console window and as "x|yz" in GUI window.
Please note that the line shown ablove appears as a
thick line.
iii)
If I want to store something like"\x\yz",it even
ignores the first backslash.
iv)
This happens when I pass it through the
function.Otherwise if I send something like"\\x\\yz"
directly without going through the function then it
stores it as "\x\yz".
v)
This is the problem with the function itself or shall
I have to do something else.
Regards,
Ravi
--- Sinisa Milivojevic <[EMAIL PROTECTED]> wrote: > 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
>
____________________________________________________________
Do You Yahoo!?
Get your free @yahoo.co.uk address at http://mail.yahoo.co.uk
or your free @yahoo.ie address at http://mail.yahoo.ie
---------------------------------------------------------------------
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