Posts: 307
Threads: 88
Joined: Feb 2015
Reputation:
0
What does Limit 1 mean in MQSQL??
UPDATE `user` SET TimeLost=%d WHERE `UserName` = '%e' LIMIT 1 - Limit 1
??
Posts: 10,066
Threads: 38
Joined: Sep 2007
Reputation:
0
Means that it will only update the first row it finds. If your username column is set as unique, which it should be, then that condition is completely redundant. Same for select statements.
Posts: 290
Threads: 7
Joined: May 2014
Reputation:
0
LIMIT 1 should be fine for this particular query, its hard to say since you didn't give us any context in terms of the code it surrounds.
Posts: 103
Threads: 0
Joined: Sep 2015
Reputation:
0
No need to have LIMIT 1 for this particular query, I doubt you'll have multiple rows with the same username in your users table.
Basically what Vince said, the username column should be unique (no duplicates).