How does php generate a barcode and fetch data?

Source: Internet
Author: User
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.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.