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…

How to implement A2F using Own Development in NodeJS in a Scriptcase application

A2F using Own Development in NodeJS A2F: In a previous article, we talked about Swivel as an extern...

Specialists or generalists, who gets a better advantage by using Scriptcase?

Hey there! Today  we will figure what are the ideal profiles for those who wish to take advantage o...

Disabling autofill and autocomplete Chrome browser in login screens

Hello, here I want to show an alternative to disable the autofill and autocomplete of the chrome bro...

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.