Punk Rock Geek Posted June 22, 2009 Share Posted June 22, 2009 I have a select query: $query = mysql_query ("SELECT * FROM tablename where id=1"); I would like to specifically return the 2nd result as a variable. How would I got about doing this? I have tried this: while ($row = mysql_fetch_array($query)) { $result = $row[1][fieldname]; } But it doesn't seem to do anything meaningful. Help? Link to comment https://forums.phpfreaks.com/topic/163201-return-only-the-2nd-result-set-in-a-query/ Share on other sites More sharing options...
joel24 Posted June 22, 2009 Share Posted June 22, 2009 $query = mysql_query ("SELECT * FROM tablename where id=1 limit 1,1"); limit x, y ... first result is 0, so its saying start at the second result (x) and then get (y) rows Link to comment https://forums.phpfreaks.com/topic/163201-return-only-the-2nd-result-set-in-a-query/#findComment-861098 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.