Thursday, 08 August 2019 08:21

How to keep your sql safe

Written by 
Rate this item
(0 votes)

If You want to become a good web developer, 

you have to learn to write secure code perfectly. 

 In php website, you should know how to secure 

codes when getting and putting data to database, 

you should aware of  simple SQL injection prevention rules. 

So to prevent sql injection you should escape any variable

that you are going to use in the database accessing codes 

In the following code variable escaping shown as an example - 

$queryResult = mysql_query ("SELECT * FROM WHERE Example_table ex_field = \" " . mysql_real_escape_string( $ ex_field ) . " \ " " ) ; 

Read 1719 times
Super User

Email This email address is being protected from spambots. You need JavaScript enabled to view it.
More in this category: « How to use php arrays

Latest discussions

  • No posts to display.