How to get the near by cities in database using latitude/longitude

If you want to found near by city or near by latitute / langitute, first you create the MySQL table with lat and lng attributes. Your table should also have an id attribute to serve as the primary key. INSERT INTO markers (name, lat, lng) VALUES (‘Delhi’,’28.7041′,’77.1025′); INSERT INTO markers (name, lat, lng) VALUES (‘Noida’,’28.5355′,’77.3910′);… Read More »

Category: PHP

What are the differences between INSERT, UPDATE, REPLACE in MySql?

These are totally different statements. Insert: Insert new record. Example : INSERT INTO table(fields) VALUES(values); Update: Update existing record Example : UPDATE table SET fields=values Where conditions; Replace: This syntax is the same as the INSERT. The old row is deleted before the new row is inserted. Example : REPLACE INTO table SET fields=values;

Update all values of a column to Upper case

Update all values of a column to upper case Mysql UPPER function is used to update field in uppercase. UPDATE table_name SET fieldname = UPPER(fieldname) example : UPDATE member SET first_name = UPPER( first_name );

Update all values of a column to lowercase

Update all values of a column to lowercase Mysql LOWER function is used to update field in lowercase. UPDATE table_name SET fieldname = LOWER(fieldname) example : UPDATE member SET first_name = LOWER( first_name );

How to use GROUP_CONCAT in mysql

GROUP_CONCAT() function is used to concatenate column values into a single string. The following illustrates the GROUP_CONCAT function: SELECT GROUP_CONCAT(country SEPARATOR ‘;’) FROM customers ORDER BY country;

How to disable the Enter key

In this tutorial, Show you how to disable the “Enter” Key. If you have an HTML form on your web page, many times your visitors may hit the ‘Enter’ key on their keyboard. Disabled Enter Key Example : <script type=”text/javascript”> function stopenterKey(evt) { var evt = (evt) ? evt : ((event) ? event : null);… Read More »

PHP Class Tutorial: Working with Methods

About the concepts of OOP in PHP5 from basics to very advanced level. We have learned about the class basic and public class properties in our previous tutorials. Today i am going to write about the basics of class methods. “Class properties allow your objects to store data and class methods allow your objects to… Read More »

Category: PHP

AngularJS Filters

Filters can be added to expressions and directives using a pipe character. AngularJS filters can be used to transform data: Filter Description currency : Format a number to a currency format. filter : Select a subset of items from an array. lowercase : Format a string to lower case. orderBy : Orders an array by… Read More »

AngularJS Controllers

AngularJS controllers control the data of AngularJS applications. AngularJS controllers are regular JavaScript Objects. AngularJS applications are controlled by controllers. The ng-controller directive defines the application controller. A controller is a JavaScript Object, created by a standard JavaScript object constructor. Example <div ng-app=”myApp” ng-controller=”myCtrl”> First Name: <input type=”text” ng-model=”firstName”> Last Name: <input type=”text” ng-model=”lastName”> Full… Read More »

AngularJS Expressions

AngularJS expressions are written inside double braces: {{ expression }}. AngularJS expressions binds data to HTML the same way as the ng-bind directive. AngularJS will “output” data exactly where the expression is written. AngularJS expressions are much like JavaScript expressions: They can contain literals, operators, and variables. Example {{ 5 + 5 }} or {{… Read More »