Tell me how do I escape data before storing it into the database?
Answer / Avinash Rathi
"To escape data before storing it into a database in PHP, you can use mysqli_real_escape_string() or PDO::quote(). Here is an example using PDO:nn$stmt = $db->prepare("INSERT INTO table (column) VALUES (:escapedData)");n$stmt->bindParam(':escapedData', $escapedData, PDO::PARAM_STR);".
| Is This Answer Correct ? | 0 Yes | 0 No |
how set session expire time in php?
what is difference between PHP4 , PHP5
How does csrf token work?
How do I check environment variables?
What is the difference between the functions strstr() and stristr()?
Is multilevel inheritance possible in php?
How to create and destroy cookies in php?
Explain Constant in Class?
What is a persistent cookie in php?
Why do we use interface in php?
Is php faster than python?
How to get the ip address of the client?