Limit Database Results

Video loading...

Join Drupalize.Me to watch this video

Join today and gain instant access to our entire video library.

Log in Sign up
  • 0:05
    with Leanna Pelham
  • 0:08
    Our app would be a little more fun to play with if we
  • 0:11
    had some more interesting pets in our pet table.
  • 0:14
    So I made a file with some SQL queries
  • 0:17
    that inserts some new furry friends.
  • 0:20
    Open up the resources/ episode 3/pets.sql file.
  • 0:24
    Cool.
  • 0:25
    Truncate is the MySQL keyword you use when you want to empty a table.
  • 0:30
    It's handy when you're developing, but try
  • 0:32
    not to use this on the production database.
Loading ...

Limit Database Results

Loading...

As we add more pets to the database, our query is going to return a lot of results. In this tutorial we'll take a look at how to control the number of results we get back from our query using LIMIT. We'll also end up introducing a security hole in our code, which we're going to correct later in this series.

Downloads: 
Log in or sign up to download companion files.

Additional resources:
There are no resources for this video. If you believe there should be, please contact us.