Re: [PHP] querying for one specific row number

2002-07-17 Thread Justin French
For starters, this is a PHP list, not MySQL. Check out the LIMIT statement in the MySQL manual. Or, if you have a primary key field like id and you KNOW that id#2 will be there, then it's a simple SELECT * FROM mytable WHERE id='2' But in the case where id#2 has been deleted, you really want

[PHP] Re: OT [PHP] querying for one specific row number

2002-07-17 Thread 1LT John W. Holmes
Off topic... > >So let's say my table had 5 rows (entries) in it, and I want to pull > >just row #2, how would I do this?? > SELECT * FROM table LIMIT 1,1; Technically, without an ORDER BY in your query, the database can return a different row each time with this query. Without an ORDER BY, how

Re: [PHP] querying for one specific row number

2002-07-17 Thread 1LT John W. Holmes
> I want query my mysql table and get one particular row. > > So let's say my table had 5 rows (entries) in it, and I want to pull > just row #2, how would I do this?? What is row #2?? The second row when the table is ordered by the first column? second column? ascending? decending? without an OR

Re: [PHP] querying for one specific row number

2002-07-17 Thread René Moonen
Phil Schwarzmann wrote: >I want query my mysql table and get one particular row. > >So let's say my table had 5 rows (entries) in it, and I want to pull >just row #2, how would I do this?? > >THANKS!! > > > It's OT but OK: SELECT * FROM table LIMIT 1,1; Have another look at the MySQL manual

Re: [PHP] querying for one specific row number

2002-07-17 Thread Martin Clifford
If you are using an auto_increment primary key field named id, then you would use this: SELECT * FROM table WHERE id=2 LIMIT 1 Just so long as you know that if for some reason you delete that row, there will NEVER Be another id of 2, unless you set it that way. If you only want to select certa

[PHP] querying for one specific row number

2002-07-17 Thread Phil Schwarzmann
I want query my mysql table and get one particular row. So let's say my table had 5 rows (entries) in it, and I want to pull just row #2, how would I do this?? THANKS!!