ציטוט:
נכתב במקור על ידי sUP
זה מוסיף סלאשים לפני " ו '
|
ציטוט:
נכתב במקור על ידי MasterT
אפשר עם התחברות למסד נתונים(כדי לבצע תאימות עם ה-mySQL), אבל 90% מהסיכויים שלא תצטרך.
|
לגבי SUP מה שאמרת זה mysql_escape_string
MASTER-T שטויות במיץ.... אתה חייב שיהיה חיבור פעיל למסד
הסיבה :
mysql_real_escape_string מוסיף סלאשים תוך כדי שימוש בקידוד שפעיל בחיבור ל MYSQL
ככה שבשביל להשתמש בה, חייב חיבור.
כל מה שצריך זה לקרוא :
http://il2.php.net/mysql_real_escape_string
קוד:
string mysql_real_escape_string ( string $unescaped_string [, resource $link_identifier] )
Escapes special characters in the unescaped_string, taking into account the current character set of the connection so that it is safe to place it in a mysql_query(). If binary data is to be inserted, this function must be used.
mysql_real_escape_string() calls MySQL's library function mysql_real_escape_string, which prepends backslashes to the following characters: \x00, \n, \r, \, ', " and \x1a.