#1

Okay so I am new at MySQL and I am following one tutorial for log/reg sys.
I found this
PHP код:
UPDATE `playersSET `deaths` = %d WHERE `id` = %d LIMIT 1 
I understand most of this but what I don't understand is this
PHP код:
WHERE `id` = %d LIMIT 1 
Can someone explain me this limit 1??

Thx in advance
Reply
#2

It means that we need only 1 result to be shown.
Reply
#3

As once it's found one result, it'll stops.
Reply
#4

Thanks guys
Reply
#5

It's pretty useless in this case since - assuming that "id" is the primary key - there will always be only one result anyway.
Reply
#6

Quote:
Originally Posted by Vince
Посмотреть сообщение
It's pretty useless in this case since - assuming that "id" is the primary key - there will always be only one result anyway.
Yeah but you'll never know xD
Reply
#7

Um yeah, you do know. That's the point of the primary key: being unique in the table. It's impossible to insert a duplicate key; MySQL simply won't let you.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)