![]() |
3.2.0? ;)
|
Quote:
Anyone ? |
Really you should use mysql_escape_string when cleansing input for the database :) That's PHPs native function. I can't understand why everyone is using addslashes still (myself included ;))
|
What about mysql_real_escape_string()? ;)
|
So basically as long as you are using something as input into an SQL query, it would be good to use mysql_real_escape_string() first, regardless of whether it is a Insert, Select or whatever kind of query ?
|
This is what PHP Devs have to say:
Quote:
|
Quote:
AFAIK they are both native and almost identical (not mysql_real.. because that one also uses the database connection to take the character set used in account). mysql_(real_)escape_string can be used since PHP 4.0.3, where addslashes was already available since PHP 3. |
I want to know whether I should use mysql_real or keep using addslashes. Someone give me a definite "this or that" answer, or else someone will be in much pain ;)
|
Sorry I was tired last night when I made that post. I meant mysql_real_escape_string, and that addslashes won't properly escape everything pasted to an SQL query like mysql_real_escape_string will :)
|
Could someone write a tutorial on how to avoid such problems, maybe all the developers will follow it, I could sure use one.
|
All times are GMT. The time now is 10:24 AM. |
Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
![]() |
|
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|