Hero192 Posted January 29, 2016 Share Posted January 29, 2016 Hey all, can anyone explain to me when should I use UPDATE and when should I use INSERT ? Link to comment
tosfera Posted January 29, 2016 Share Posted January 29, 2016 INSERT is when you want to add a new record to your database, the UPDATE is only used to manipulate data. Lets say; A user registers a new account on your server => insert Someone changes their password => update You create a new vehicle and save it in your database => insert The vehicle changed from color => update Link to comment
Hero192 Posted January 29, 2016 Author Share Posted January 29, 2016 Thank you for the clear informations & for your examples. By the way, I start doing a login system I want to store password in should I use the value as TEXT or INTEGER? because as you know, Passwords can't be controlled it can be numbers and words in same time dbExec (connection, "CREATE TABLE IF NOT EXISTS data (account TEXT, password TEXT)" ) Thanks in advance. Link to comment
tosfera Posted January 29, 2016 Share Posted January 29, 2016 There is your answer, not even a single has is only numbers. Therefore it should be a text or varchar(45), since the hash from these days isn't longer than that. Link to comment
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