Re: querying for one specific row number

From: Date: Wed, 17 Jul 2002 14:29:36 +0000
Subject: Re: querying for one specific row number
Groups: php.general 
Request: Send a blank email to php-general+get-108087@lists.php.net to get a copy of this message
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 certain columns from the row, then list those columns in place of the wildcard. SELECT first_name, last_name FROM table WHERE id=1 LIMIT 1 HTH! Martin Clifford Homepage: http://www.completesource.net Developer's Forums: http://www.completesource.net/forums/ >>> "Phil Schwarzmann" <pschwar@jhmi.edu> 07/17/02 10:21AM >>> 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!!

« previous php.general (#108087) next »