I prefer to use PDO when working with database. I would say, that it is a standard these days.
You should always escape input that is not directly under your control. That includes values which come from $_SERVER as well. It might look like safe source of data, but that is not always correct. This is a good read regarding values coming from $_SERVER.
You can easily avoid SQL injection by using prepared statements prepared statements. There is no need to create your SQL queries by putting values from variables directly inside SQL queries.
"\""
can be simplified to this'"'
- if a string does not contain any variables it should be wrapped into
''
instead of""
, because PHP interpreter does not need to check if a string contains variables in that case
I prefer to use PDO when working with database. I would say, that it is a standard these days.
You should always escape input that is not directly under your control. That includes values which come from $_SERVER as well. It might look like safe source of data, but that is not always correct. This is a good read regarding values coming from $_SERVER.
You can easily avoid SQL injection by using prepared statements. There is no need to create your SQL queries by putting values from variables directly inside SQL queries.
"\""
can be simplified to this'"'
- if a string does not contain any variables it should be wrapped into
''
instead of""
, because PHP interpreter does not need to check if a string contains variables in that case
I prefer to use PDO when working with database. I would say, that it is a standard these days.
You should always escape input that is not directly under your control. That includes values which come from $_SERVER as well. It might look like safe source of data, but that is not always correct. This is a good read regarding values coming from $_SERVER.
You can easily avoid SQL injection by using prepared statements. There is no need to create your SQL queries by putting values from variables directly inside SQL queries.
"\""
can be simplified to this'"'
- if a string does not contain any variables it should be wrapped into
''
instead of""
, because PHP interpreter does not need to check if a string contains variables in that case
I prefer to use PDO when working with database. I would say, that it is a standard these days.
You should always escape input that is not directly under your control. That includes values which come from $_SERVER as well. It might look like safe source of data, but that is not always correct. This This is a good read regarding values coming from $_SERVER.
You can easily avoid SQL injection by using prepared statements. There is no need to create your SQL queries by putting values from variables directly inside SQL queries.
"\""
can be simplified to this'"'
- if a string does not contain any variables it should be wrapped into
''
instead of""
, because PHP interpreter does not need to check if a string contains variables in that case
I prefer to use PDO when working with database. I would say, that it is a standard these days.
You should always escape input that is not directly under your control. That includes values which come from $_SERVER as well. It might look like safe source of data, but that is not always correct. This is a good read regarding values coming from $_SERVER.
You can easily avoid SQL injection by using prepared statements. There is no need to create your SQL queries by putting values from variables directly inside SQL queries.
"\""
can be simplified to this'"'
- if a string does not contain any variables it should be wrapped into
''
instead of""
, because PHP interpreter does not need to check if a string contains variables in that case
I prefer to use PDO when working with database. I would say, that it is a standard these days.
You should always escape input that is not directly under your control. That includes values which come from $_SERVER as well. It might look like safe source of data, but that is not always correct. This is a good read regarding values coming from $_SERVER.
You can easily avoid SQL injection by using prepared statements. There is no need to create your SQL queries by putting values from variables directly inside SQL queries.
"\""
can be simplified to this'"'
- if a string does not contain any variables it should be wrapped into
''
instead of""
, because PHP interpreter does not need to check if a string contains variables in that case
I prefer to use PDO when working with database. I would say, that it is a standard these days.
You should always escape input that is not directly under your control. That includes values which come from $_SERVER as well. It might look like safe source of data, but that is not always correct. This is a good read regarding values coming from $_SERVER.
You can easily avoid SQL injection by using prepared statements. There is no need to create your SQL queries by putting values from variables directly inside SQL queries.
"\""
can be simplified to this'"'
- if a string does not contain any variables it should be wrapped into
''
instead of""
, because PHP interpreter does not need to check if a string contains variables in that case