It is common in web application there is the return of a very large volume of records when performing a query tables that store large amounts of data need a parameter must stop for a simple query does not lock any application.

For queries with a very large volume of returns are optimized LIMIT command is used, it is responsible for determining exactly which records will appear through an initial and final number.

To use the LIMIT command just add it in the query syntax as shown below:

SELECT [Fields] FROM [Table] LIMIT [X,X]

The parameters to be specified for the command LIMIT points indicate that the records should be displayed and how far they will appear. We go to a practical example.

SELECT Cod_prod, Name

FROM Product

LIMIT 0,8

Using the above command will be shown only eight records in the query starting with the first record (index 0). If you want the query to start at another location just indicate it in the first parameter.

The LIMIT command is used in various situations, among the key can highlight pagers. They are widely used by web applications and help a lot in order to optimize the speed of them.

mysql

Want to know more about MySQL and how it can offer numerous advantages for projects in PHP? Then visit our page on PHP and MySQL and discover several advantages over these two important technologies available in the market.

You might also like…

PROCESAMIENTO AJAX EN SCRIPTCASE

Ajax en los formularios de Scriptcase puede usarse para recargar un campo de tipo de select basado e...

IMPORTAR IMAGENES DE LA BASE DE DATOS Y UTILIZAR CLASES DE BOOSTRAP

Como muchas personas ya saben, Bootstrap es una biblioteca de front-end libre y de código abierto p...

TENDENCIAS DE DESARROLLO WEB PARA 2017

Usted verá en este post tendencias para 2017 en Diseño Web, en el medio digital y en el desarrollo...

Comment this post

Get new posts, resources, offers and more each week.

We will use the information you provide to update you about our Newsletter and Special Offers. You can unsubscribe any time you want by clinck in a link in the footer of any email you receive from us, or by contacting us at sales@scriptcase.net. Learn more about our Privacy Police.