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? Quote Link to comment 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 Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.