I have a column A; I want to be able to have A[0] column to contain the latest value, A[1] to contain the most recent and so forth. Is this possible? If not is there an alternative?
I have a column A ; I want to be able to have A[0]
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
I’m not sure if MySQL can store arrays in a column. You might be better off with a
password_historytable, with this structure:passwordis, well, the password!user_idis the ID of the user that this record’s password belongs to.sequence_numbertells you which password this is. Start with 0 for the first password, and just increase it everytime they change their password. You could also store the date that the password was created, instead of a sequence number, if you like that more.password_history_idis just a key column, but you could also not use this, and make the primary key a combination of the other three (and those combinations should always be unique, anyway).