Closed Thread Icon

Preserved Topic: MySQL prob. Pages that link to <a href="https://ozoneasylum.com/backlink?for=20991" title="Pages that link to Preserved Topic: MySQL prob." rel="nofollow" >Preserved Topic: MySQL prob.\

 
Author Thread
bitdamaged
Maniac (V) Mad Scientist

From: 100101010011 <-- right about here
Insane since: Mar 2000

posted posted 06-21-2001 23:04

Hola, this one is bugging me and I think it's my syntax

I have a guestbook table that has a couple of columns the issues here are the "note" column and the note_date column

When someone enters a note it gets the date.

Now I am pulling the latest 10 from the db like this

"SELECT note FROM guestbook ORDER BY note_date DESC LIMIT 0, 5"

that works great I get the last 5 entries of my guestbook.
Now I'm trying to make it so you can navigate through the guestbook 5 entries at a time. So I have a PHP script that is writing out the links. However on these pages when I use a query like this:

SELECT note FROM guestbook ORDER BY id desc LIMIT 10, 15

I get a result set like this

+-------+----+

mr.maX
Maniac (V) Mad Scientist

From: Belgrade, Serbia
Insane since: Sep 2000

posted posted 06-21-2001 23:13

The correct syntax for LIMIT is this:

[LIMIT [offset,] rows]

So you should write that part like this:

LIMIT 10, 5

bitdamaged
Maniac (V) Mad Scientist

From: 100101010011 <-- right about here
Insane since: Mar 2000

posted posted 06-21-2001 23:17

cool deal I figured I had something wrong in the syntax

thanks max


Walking the Earth like Kane

« BackwardsOnwards »

Show Forum Drop Down Menu