Originally posted by dougp23
Hmmm....
that sounds easy enough! I have a big PHP book I am waltzing thru, I come from the Access/VB world, where we have recordsets, and we can move through them (MoveFirst, MoveNext, MoveLast, etc.)
I will try to dig through the book some more and get what you are saying! I take it $index is a function in PHP or MySQL. I must say PHP and MySQL are very nice, and pretty easy to follow. Guess I mucked up my brain with those years of MSAccess/VBA.
Thanks.
Doug
Yes you have mucked it up nicely LOL jk
Let me try this again.
I am assuming that you've created some sort relationship between students and teachers. So lets say I am a teacher and my ID (internally to the db) is the number 100.
Once I've logged in the script retrieves all student ID's that "belong" to teacher #100. So lets say it grabs a dozen student ID's and put's them in an integer based array... lets call it $array.
also
a value (let's call it $index) is set to 0 and represents our current position in the array.
now for loading info for each student...
Your query would look something like this.. mind you I have no idea how your tables are defined.
SELECT * FROM students WHERE student_id = '$array[$index]'
display that student's info... make the necessary updates (grades, conduct, etc that you mentioned above)
and clicking next saves the data, and increments $index so that the query looks to the next student ID in the array.
I mentioned using Sessions above... I'll probably get flamed for it but oh well... Sessions can save you a lot of work, especially if you are working in a controlled (private intranet, etc) kind of environment where security levels do not have to be set to "ultra paranoid".
In case you dont know... a session allows you to keep data nicely and neatly in one place as your apps jump from page to page. Think of it as a global that can be shared between scripts.