Witaj Gościu! ( Zaloguj | Rejestruj )

Forum PHP.pl

 
Reply to this topicStart new topic
> addslashes i mysql_escape_string ?
mablo
post
Post #1





Grupa: Zarejestrowani
Postów: 120
Pomógł: 1
Dołączył: 11.04.2005
Skąd: Poznań

Ostrzeżenie: (0%)
-----


Czy ktoś mi może powiedzieć czym sie różni addslashes od mysql_escape_string questionmark.gif

Bo wg mnie to jest to samo. Ale po co mieli by robić dwa polecenia, które różną sie tylko nazwą questionmark.gif
Go to the top of the page
+Quote Post
vik-ing
post
Post #2





Grupa: Zarejestrowani
Postów: 11
Pomógł: 0
Dołączył: 1.03.2005

Ostrzeżenie: (0%)
-----


You MySQL folks might also want to check out mysql_escape_string().

--------- copied from mysql_escape_string():
If you're wondering what's the difference between mysql_escape_string() and
AddSlashes(), I found this from looking at the source code of MySQL
3.23.32 and php 4.0.6:

- mysql_escape_string calls MySQL's library function of the same name,
which prepends slashes to the following characters: NUL (\x00), \n, \r, \,
', " and \x1a.

- AddSlashes escapes NUL, ', " and \.

While mysql_escape_string seems safer, my experience shows that escaping
strings with AddSlashes (which is also done automatically if
magic_quotes_gpc is on) is sufficient, so it seems you can pick whichever
you wish.


Zrodlo : php.net


pozatym lepiej uzyc mysql_real_escape_string()

Ten post edytował vik-ing 12.04.2005, 21:01:07
Go to the top of the page
+Quote Post

Reply to this topicStart new topic
1 Użytkowników czyta ten temat (1 Gości i 0 Anonimowych użytkowników)
0 Zarejestrowanych:

 



RSS Aktualny czas: 21.08.2025 - 18:46