I have a registration application for registering 6 courses. The program will check the repeated register users first. Those users that needed to be checked comes from last year. If users registered for one course, they cannot register for any other courses.
---firstroundregisted table structure--- id|englishname |idcard | 1 |CHAN SIU MING|A1234 | 2 |TAK HO KANG |Z4123 | ---Contain >5000 last year registered users records for the 6 courses---
The sql in PHP as below.
SELECT * FROM firstroundregisted WHERE englishname='".$_POST['studentname']."' AND idcard='".$_POST['idcard']."' LIMIT 1;
Is this sql the fastest way to find out if the user registered or not?
I asked a question here : How to increase Max_used_connections? Some gentlemen suggested me to optimizing the sql query so I start a new question to focus on optimizing. Thank you all for your help.