How to get the size of screen window using jQuery?

you can get the size of the window or document using jQuery methods: $(window).height(); // returns height of browser viewport $(document).height(); // returns height of HTML document (same as pageHeight in screenshot) $(window).width(); // returns width of browser viewport $(document).width(); // returns width of HTML document (same as pageWidth in screenshot) A non-jQuery way to… Read More »

How to Auto Refresh Page Every 10 Seconds

There are multiple solutions for this. If you want the page to be refreshed you actually don’t need JavaScript, Just a simple line of code in the head section can refresh the page <meta http-equiv=”refresh” content=”30″/> The browser will then refresh the page every 30 seconds. If you want refresh the page with javascript code… Read More »

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 »