I would like to know if there is a way to select the first row in a table. Once I've selected and pulled out the info I needed from that first record, I then would like to select the next row in the table.
Thanks
Selecting certain rows in a mysql table.
Moderator: General Moderators
- feyd
- Neighborhood Spidermoddy
- Posts: 31559
- Joined: Mon Mar 29, 2004 3:24 pm
- Location: Bothell, Washington, USA
Code: Select all
$query = mysql_query('SELECT * FROM `table`);
while($row = mysql_fetch_assoc($query))
{
// do stuff for each row.
}- feyd
- Neighborhood Spidermoddy
- Posts: 31559
- Joined: Mon Mar 29, 2004 3:24 pm
- Location: Bothell, Washington, USA
Code: Select all
SELECT * FROM `table` LIMIT 2