use qr codes to store information in a database

30,118

Solution 1

In general that certainly is possible. Actually every QRCode / barcode stores information. But usually the size of that information is pretty small. Typically only references like URLs or numbers (IDs) are stored and the 'real' data is retrieved from a database using those references. But strictly speaking that is a form of storing information in a QRCode / barcode.

Looking closely we see that the data is stored in the code itself, not inside a database if we are talking about that small amount of data. Certainly that data can be stored inside a database when the code is read, all you need is a trivial piece of software. But that makes little sense in most cases, since the data already is stored. If you want to use a database to combine data from different sources, so if you only want to use codes as a means of transport, then reading the codes is just a replacement for typing the information in with a keyboard. So no magic here, nothing code specific you have to consider.

If you are talking about bigger amounts of data, then you have to use other types of codes. The one I like most are dataglyphs. They even provide a pretty big fault tolerance.

Solution 2

QR-codes can only store information. Common use of QR-codes is to store an URL to a specific page within the QR-code matrix. The QR-code may then be read with a smartphone app. It is the app itself that will identify the contents of the QR-code as an URL.

In your case it would be possible to encode receipt information into the QR-code and then, via a specialized reader app, read and interpret the contents of the QR-code and make the app store it into a database.

Solution 3

In essence, a QR code is just a certain way to represent information. In itself, the QR code will never interact with a database.

However, it would be fairly trivial to put the information you mention into an http request which you encode in a QR code. Whenever someone would then scan the QR code it could send this information to a web service which would store the data in a database.

Alternatively you could create your own scanning app which simply reads the data from the code and connects to a database, it all depends on how much control you have over the environment and how accessible you want everything to be.

Share:
30,118
user1264844
Author by

user1264844

Updated on September 17, 2020

Comments

  • user1264844
    user1264844 over 3 years

    I am new to QR codes and wanted to know if it were possible for a QR code to store values into a database? For example, if a receipt printed out a QR code, and the company can scan the receipt's QR code to store details such as; the time of purchase, price etc.

    All instances of QR codes I have found so far are just retrieval of information rather than storing. Thanks for any help, again I am completely new to this technology and apologise if this question is really silly. I did use the search but I haven't found anything on the internet let alone here.

    Thanks again for any help.