feck Posted January 20, 2007 Share Posted January 20, 2007 I have a form that is filled out from the first row of a query, using MySQL.My problem is this, how do you then redisplay the form displaying the results from the second row of the query, and the third and the fourth and so on...Any examples would be a great help. Link to comment Share on other sites More sharing options...
MrAdam Posted January 20, 2007 Share Posted January 20, 2007 in your query .. at the end you can put: "LIMIT 1, 1" .. the first '1' is where to start from.. and the second is how many to display.. so:LIMIT 1, 1 = first rowLIMIT 2, 1 = second rowLIMIT 3, 1 = third rowetc..example in a MySQL query: SELECT * FROM table LIMIT 1, 1 Link to comment Share on other sites More sharing options...
feck Posted January 20, 2007 Author Share Posted January 20, 2007 So the select query you have suggested will only still retrieve the first row?How do you then use LIMIT 2.1 too retrieve the second row and display this on the same page?Maybe I need to explain a bit more.Say I have two text fields that display the results from a table with only two main colums.I know I can retrieve the first row or any row for that matter by manipulating the SQL query in some way.But once the row is retrieved and displayed using only two text boxes, how then with say the help of a submit button would I be able to navigate to and display the next row of the query.Basically what I need is a way of letting the user see the results of a first row, and deciding wether they want to edit this data. Maybe they do, or maybe the data is in the next row, or the one after and so on.At this point all i want too do is display the second row by clicking a button, and redisplaying the form with the new values retrieved from the database. Link to comment Share on other sites More sharing options...
MrAdam Posted January 20, 2007 Share Posted January 20, 2007 Ahh I think I get you. I'd say you'll probably need to use "AJAX" / "JavaScript" to be able to get a row of data from the database without refreshing the page.w3schools.com has tutorials for both. Link to comment Share on other sites More sharing options...
feck Posted January 20, 2007 Author Share Posted January 20, 2007 Cheers MrAdam,Thats exactly what I thought, or came too the conclusion of anyway. Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now