#1
  1. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Oct 2004
    Posts
    61
    Rep Power
    10

    Barcode, php, mysql


    I am very new to Barcode systems, however I have good enough knowledge to create html, php and mysql (light applications) applications.

    Using barcode I'd like to achive simplifying our stock take process.

    What I was thinking to print a unique id for each product on a barcode:

    define following on the mysql database:

    id
    1234

    name
    a product name

    size
    a product size

    quantity
    number of items in the batch

    date entered
    date entered

    When the barcode reads the id, by using a simple PHP script with simple HMTL form, I would like to add or delete a product from the database.

    How is this possible?

    Is there any examples that I can go through?
  2. #2
  3. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Dec 2005
    Location
    Vancouver, WA, USA
    Posts
    397
    Rep Power
    189
    Most barcode readers can be set to input just like a keyboard. I have mine to also add a carriage return after the input.

    So if it reads a barcode for 1234 it will enter 1234 plus a carriage return where ever the prompt is.

    You then build a web form with an input field. Use a bit of Javascript to make sure that after you load the page, it drops focus on that field. You scan the number, and it's the same as typing it in, and hitting submit.

    Comments on this post

    • Northie agrees : That's how I did it
    Thomas Tremain
  4. #3
  5. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Oct 2004
    Posts
    61
    Rep Power
    10
    Originally Posted by ttremain
    Most barcode readers can be set to input just like a keyboard. I have mine to also add a carriage return after the input.

    So if it reads a barcode for 1234 it will enter 1234 plus a carriage return where ever the prompt is.

    You then build a web form with an input field. Use a bit of Javascript to make sure that after you load the page, it drops focus on that field. You scan the number, and it's the same as typing it in, and hitting submit.
    Many thanks for your reply. So the example above is for one data field. What about adding multiple fields as:

    1) Product ID: 1234

    2) Quantity: 4

    How can I define this in the barcode, also how can I create the barcode and how can I create the data fields accordingly?

    Also do you recommend any "dumb" not smart barcodes (cheap) or any with keyboard functionality will work?
  6. #4
  7. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Dec 2005
    Location
    Vancouver, WA, USA
    Posts
    397
    Rep Power
    189
    I guess you could create a barcode for "4-1234", or a separate barcode for "qty-4" then you scan it, and follow it up with a scan for the product "1234".

    To print barcodes, I use a p-touch label printer. The software allows me to import from many sources, like a CSV. I've not gotten around to linking to my mysql database, via an ODBC connection yet. Maybe this year.

    I think this is off topic for PHP, but the scanner I'm using is an older model:
    http://www.metrolinedirect.com/hhp-3870-wireless-scanner.html

    If I was looking for a simple scanner again, I'd get one with a cradle type charger.

    I do plan on upgrading this year to a smart scanner, one that will run some form of Windows, then I can make some hotkeys out of different buttons. An example that might fit your app, would be: press a button for "Inventory" then enter the quantity with the buttons on the scanner itself, and then scan the product.

    Your software would have to match your application. If it's browser enabled, you could write it in PHP. I have not done it yet. (because I don't have a smart scanner) So far I've just used the browser on the attached PC. Run over, click a few things, to setup what screen I want, then run around and scan whatever it is I need.

    Each item either goes in as a form submission by itself, or each as a single line in a <textarea>, then I submit when I have all the items I want.

    In short, you don't typically use the scanner to enter "5 candy bars". Think of the grocery store, either they scan each item one at a time, or they scan one of them the number of times to match the quantity, or they enter 5 on their keyboard, and scan it once.

    If you are trying to add items with different "options" you will need a different item number for each possibility.

    Item 34: small shirt white
    Item 35: small shirt red
    Item 36: medium shirt white
    Item 37: medium shirt Red


    Now, a barcode can also contain letters as well as numbers.
    Your itemid could be alphanumeric:

    34SW
    34SR
    34MW
    34MR

    Letters take up more space on most barcode types. A 4 digit number is going to be narrower than a 4 digit number with letters.

    That is probably about as much info as I can give you, since it's not real relevant to this forum.

    Send me a PM if you need anything more.
    Thomas Tremain
  8. #5
  9. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Oct 2004
    Posts
    61
    Rep Power
    10
    now I understand how barcoding works,

    Many thanks, I will PM if I need any help

IMN logo majestic logo threadwatch logo seochat tools logo