This article explains basics of SQL Injection with an example that shows SQL Injection, and provides methods to prevent from these attacks. As the name suggests,this attack can be done with SQL queries. Many web developers are unaware of how an attacker can tamper with the SQL queries. SQL-Injection can be done on a web application…
Archive for the ‘Database’ Category
Tags: How to Prevent SQL Injection Attack Tutorial, How to Prevent SQL Injection Attack Tutorial in php, SQL injection, SQL Injection Tutorial in php, web developers, What is SQL Injection and How to Fix It
Tags: Date and Time Functions, how i add days in mysql date ?, interval, lt, nbsp
Here is an example that uses date functions. The following query selects all rows with a
date_col value from within the last 30 days:
WHERE DATE_SUB(CURDATE(),INTERVAL 30 DAY) <=
The query also selects rows with dates that lie in the future.
And try also that
SELECT * FROM
> ‘2013/07/03’ order by
Google Map API has been a great way to show geographical information on web. A lot of mashup tools like this, have been created around Google Maps to show a wide variety of data. In my previous article about Introduction to Google Maps API, I had described basic APIs to integrate Google Map in your webpage. In this small article we will discuss a great feature of Google Maps API that can be used to locate any City/Country/Place on Map. This is called Geocoding.
Google Maps API provides a wonderful API called Geocoding API that enables you to fetch any location and pin point it on Google Map.
GClientGeocoder is the class that we use to get the geocoder that get us the location. We will use getLatLng() method to get latitude/longitude of any location.
Check the following code.
In above code snippet we passed string “New York” and a handler function to getLatLng() method of GClientGeocoder. GClientGeocoder class will call google server for the location and when it gets the result, it pass the result to the handler function that we specified. Thus handler function will get point (GPoint) object from which we can get the latitude and longitude of location. In above code we have created a marker and placed it on the map.
Tags: Create your own Search Engine
Google Custom Search API are wonderful tools to create some awesome search engine like tools. Also if you want to add a search option to your website and customize the look and feel of your search results, Google Custom Search API serve best to you.
Ring in Spring with Stunning Lingerie from Journelle and get $25 OFF purchases of $200 or more! Use promo code: SPRING200. Offer valid 2/22/13-4/30/13. Shop Now
I have created a Real Time Search engine (I call it real time as it search as you type). I am really impressed by the speed/response of Google Search API.
I will show the code for one of the search api that I implemented in demo page. Let us see how to implement Web Search API.
In order to use Google Search API, you have to first generate a Key for you. Go to following page and signup your self for the Key.
Sign up for Google API Key
Step 2: Add HTML Container for Web Search
We will create a textbox and a button that will take input for search. And a DIV that will be populated by results:
When user will write a query and push Search button, a request will be made to Google Search using Custom Search API and the results are fetched. These results are then copied into the DIV.
The code in plain english is:
1. Create an object to connect Google Web search using class
2. Set a callback function that will get call once the results for the search are fetched.
3. Call the
execute() method with search query as argument.
4. In callback function, iterate through the results and copy it to container DIV.