If we try to execute a simple MySQL query or any database query that contains reserved word as a table or column name we come across syntax errors.
We have discuss two options to have Defense from syntax error using a reserved word as a table or column name.
Tag » Query
Retrieving the last record in each group
Many times we need to retrieve the last record in each group while working with database. Here group is set of those rows which have a identical column value.
You can use a ‘GROUP BY‘ to obtain the result but query with ‘LEFT JOIN‘ performs far better.
Methods and tips to prevent SQL Injection attacks
In this article we are presented with few methods and tips to prevent SQL Injection attacks in our web application.
In simple term when an application takes user data as an input, there is an opportunity for a malicious user to enter carefully crafted data that causes the input to be interpreted as part of a SQL query instead of data in our application.
What is SQL Injection
SQL Injection is the hacking technique which attempts to pass SQL commands (statements) through a web application for execution by the backend database. If user input is inserted without modification into an SQL query, then the application becomes vulnerable to SQL injection