fj1200 Posted October 14, 2008 Share Posted October 14, 2008 Hi - hope someone can save my sanity here. I have a barcode - interleaved 2 of 5 (required as a 2nd barcode is also an industry std I 2 of 5) in the form 09010202. It is made up of pairs if digits which I then split out in the php web page thus: //SITE BARCODE BREAKDOWN $bc_site=substr($_POST[rs_barcode],0,2); <------ causing me problems!! $bc_press=substr($_POST[rs_barcode],3,2); $bc_reelstand=substr($_POST[rs_barcode],5,2); $bc_arm=substr($_POST[rs_barcode],7,2); The first row arrowed is causing the issue. I need the leading zero included as it throws everything else out. This is then inserted into a MySQL database. All works fine except than it has started to drop the first zero. I can cope with that in the database using the zerofill option, but in the above example I end up with $bc_press = 90 instead of 09, which then screws up my lookups for the reports. It was working, and now it isn't. Can anyone shed any light on it please? Quote Link to comment Share on other sites More sharing options...
fj1200 Posted October 14, 2008 Author Share Posted October 14, 2008 Typical isn't it!! Soon as I post a question I get it working! //SITE BARCODE BREAKDOWN $bc_site=substr($_POST[rs_barcode],0,2); $bc_press=substr($_POST[rs_barcode],2,2); $bc_reelstand=substr($_POST[rs_barcode],4,2); $bc_arm=substr($_POST[rs_barcode],6,2); Already tried that and it didn't work though! I dunno - sometimes I hate computers! The first pair were definately causing me issues - the only changes are after that, but I wasn't getting '01' in the database I was getting '10' but it's now seeing the first zero. Can anyone suggest what I've done to make it work cos I have no idea! Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.