If i use rID = NULL while inserting each row it would increment rID in second row i guess and so oon.
How can i insert a row with an increment in rID when SID changes.
Can some one please help me...
I would like to give some clarification....
rId is response id which means that each individual user must have a distinct id and sid is a survey id and qid is question id where each survey might have 10 questions or so.
How can i generate rId to be distinct for each user that is submitting the survey.
If we generate rId manually how can i know rId of the previous user and if many users r submitting the survey simultanelosly how would it know what rId value it should take.
i'm going to make the assumption that each user's responses to the survey are to be processed as a group
furthermore, i assume you have some sort of application that will screen/filter/edit/process/validate these responses, and this application will know when a user's set of responses has been submitted as a group
if the users do not already have user_ids (for example, in an anonymous survey), then all you have to do is add a new entry to a controlling "userresponse" table, logging the datetime that this group of responses were processed, and obtaining an auto_increment id value for this user
then use this value when entering the responses into the above table
i.e. don't use an auto_increment in the above table