Jump to content

Recommended Posts

Hi everyone,

 

I have the following query to select things from my database table. Im also trying to get it for ignore the first 10 results, so that it selects everything from row 11 onwards.

 

mysql_query("SELECT * FROM table ORDER BY date DESC LIMIT 10");

 

Does anybody know how I would achieve this?

 

Thanks

Link to comment
https://forums.phpfreaks.com/topic/235081-ignore-first-10-rows/
Share on other sites

  • 4 years later...

Hi JKG,

 

Just out of curiosity, what benefits would it give me by just selecting the columns that i need rather than selecting everything? I have wondered about this before.

 

Thanks mate.

 

One other important benefit is you know what columns you are dealing with. If you come back to your code a year later or someone else reads the code, you will have to go look at the DB to see what is there or print_r the result. Aside from that selecting data you don't need by using * is just lazy.

Edited by benanamen
This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.