Join the social network of Tech Nerds, increase skill rank, get work, manage projects...
 
  • How to limit data in selections from MySQL

    • 0
    • 0
    • 0
    • 0
    • 0
    • 0
    • 0
    • 0
    • 103
    Comment on it

    In PHP if we are working on database and it is required to limit the data we want from the select query we can do it by appending a clause in the query. This can be helpful in pagination etc in our page.

    Lets take an example in which we are required to fetch only 40 records:

    $sql = "SELECT * FROM EMP LIMIT 40";
    

    The above sql query when gets executed it will give only 40 records as a result.
    The large number of data sometimes lowers the performance so there limiting the data improves the performance.

 0 Comment(s)

Sign In
                           OR                           
                           OR                           
Register

Sign up using

                           OR                           
Forgot Password
Fill out the form below and instructions to reset your password will be emailed to you:
Reset Password
Fill out the form below and reset your password: