July 22 2014

Jquery Smooth Scroll to an Element Without Using Plugin

Tagged Under :

Jquery provide a lot of useful plugin. But sometimes you are allow using pure jQuery to complete the feature.

Below example code showing how to using pure jQuery to completed scroll to element feature.
JQuery smooth scroll example code

July 19 2014

Joomla prevent SQL injections in custom query

Tagged Under : , ,

For custom query in Joomla is not prevent the SQL injections issue. So that, we need to add some script to the query.

In Joomla we can using $db->quote($param) to prevent SQL injections in custom query.

The Example of the query:
$db = JFactory::getDbo();
$query = "INSERT INTO table (`username`, `password`) VALUES (".$db->quote($username).", $db->quote($password))";
In the query you not need to add Single Quote Symbol. Because it will help you add in your query.