简体   繁体   English

在PHP中输入数据库的条形码失败

[英]Barcode input into database fails in php

When i scan a barcode in "form" it automatically inserts it in database but two first digits are missing (two first zeros) . 当我以“形式”扫描条形码时,它会自动将其插入数据库中,但缺少两个第一个数字(两个第一个零)。 So , for example if a barcode 0020166196800002 is scanned and inserted into database only number 20166196800002 is inserted without first two digits of "00". 因此,例如,如果扫描条形码0020166196800002并将其插入到数据库中,则仅插入数字20166196800002而没有前两位“00”。 Please, help! 请帮忙!

Databases do strip leading zeros if the column type is numeric and there is no zero padding configured. 如果列类型为数字并且未配置零填充,则数据库会删除前导零。

For example, MySQL allows a column to be defined with "zerofill(x)", which results in every number being at least x digits long, and a stored zero will come up as x 0 characters instead of only one. 例如,MySQL允许使用“zerofill(x)”定义列,这会导致每个数字至少为x位长,并且存储的零将显示为x 0字符而不是仅一个。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM