I want to show a student's details after the barcode scanner is swept
My idea is to add a barcode field to the database, and every time you add a student, a random, non-repeating bar code with 9 digits is added to the database together with the student information, and then when the scanner scans, the barcode number is placed in text for SQL search (like the scanner and keyboard input?). ), from the database search to the bar code numbers to get peer student information to display.
May I ask how this works? Is there any better way?
Reply to discussion (solution)
Generate two-dimensional code with JavaScript on the line, scanner and keyboard input almost, the cursor in the input box when the scan will automatically fill the information into the input box
JavaScript generates two-dimensional code
jquery Draw Barcodes
Using the user ID as the barcode content, after scanning to obtain the user ID and then call the API to obtain user data.
Barcode generation See the example above.
Bar code content with the number on the line, do not add additional fields