-2

For a school project i'm making a web portfolio. On my site i'm using a subject: "Projects" on my site these are three colums. My question is to generated them from the last three rows from my database, but i can't get it fixed. Can any body help me?

What i need is to select the last second row from a database so I can display it in my portfolio

Joppe Meijers
  • 81
  • 1
  • 9

1 Answers1

1
SELECT * FROM [table name] WHERE 1 ORDER BY id DESC LIMIT 1,1 ;

Where id can be auto increment primary key of your table. its Mysql query syntax

Rupal Javiya
  • 591
  • 5
  • 14
  • Product specific answer, to a question with no dbms specified. At least tell OP which dbms this is for. – jarlh May 25 '16 at 09:47
  • @jarlh, yep added. For SQL query syntax, check accepted answer at http://stackoverflow.com/questions/8198962/taking-the-second-last-row-with-only-one-select-in-sql-server – Rupal Javiya May 25 '16 at 09:54