A Conversation for Website Developer's Forum

MySQL question

Post 1

Frankie Roberto

Hmm, just noticed that this entry is categorised in Abi's out tray...

Anyway, my question is, when you send an SQL querey to select a load of records from the database, and those records are ordered on a certain field (eg date or alphabetical), how do you 'skip' a certain number of results from the beginning?

eg. something like "SELECT * FROM * ORDER BY date SKIP 9 LIMIT 12"

I could just receive all the records, and skip some of them in the PHP script, but that would be slower...


MySQL question

Post 2

dElaphant (and Zeppo his dog (and Gummo, Zeppos dog)) - Left my apostrophes at the BBC

SELECT * FROM * ORDER BY date LIMIT 9, 12

smiley - dog


MySQL question

Post 3

Frankie Roberto

Cheers for the fast response - did the trick.

Actually, think I probably knew that but forgot the syntax. I don't actually *know* SQL, just know enough to use it, mainly by copying and pasting bits from code i've already written.


MySQL question

Post 4

dElaphant (and Zeppo his dog (and Gummo, Zeppos dog)) - Left my apostrophes at the BBC

Isn't that how we all do it? I just happened to know exactly where I had used that before.
smiley - dog


MySQL question

Post 5

Frankie Roberto

lol, cheers.

Frankie
STW


MySQL question

Post 6

DoctorMO (Keeper of the Computer, Guru, Community Artist)

I thought was the way all programming worked?

Oh well.. smiley - winkeye

-- DoctorMO --


Key: Complain about this post