How does php generate a barcode and fetch data? I want to display the details of a student after scanning the barcode scanner.
My idea is to add a bar code field to the database. each time a student is added, a random, non-repeating bar code with a nine-digit number is generated and added to the database together with the student information, then, when the scanner scans, it puts the bar code numbers into text for SQL search (I heard that the scanner is the same as the keyboard input ?), From the database search to the bar code number, you can get the information of students in the same row and then display it.
Is this feasible? Is there any better way?
Reply to discussion (solution)
Generate a QR code using JavaScript. the scanner is similar to the keyboard input. the cursor automatically fills in the information in the input box when scanning the input box.
Generate QR code using javascript
Draw a bar code using jquery
Use the user ID as the bar code content. after scanning, obtain the user ID and then call the api to obtain the user information.
See the example of generating a bar code.
You can use the student ID for the barcode content. you do not need to add additional fields.