stig1 Posted May 5, 2009 Share Posted May 5, 2009 When I extract data from the as400 data system, to insert or update into mysql, there is all the extra white space & spaces in the mysql database after insert. For example: These paper bags are made from 100gsm brown kraft paper.| They have a card in the bottom of the bag and a paper handle.| Size: 320mm (width) x 120mm (gusset) x 460mm (height)| Would like it to be inserted or updated in mysql to look like the following: These paper bags are made from 100gsm brown kraft paper.|They have a card in the bottom of the bag and a paper handle.|Size: 320mm (width) x 120mm (gusset) x 460mm (height)| Any ideas how I could achieve this, a function would be great as there are many fields like this, so if i can just feed the as400 database field into the function would be perfect. Any help is always apprecaited greatly. Link to comment https://forums.phpfreaks.com/topic/157004-remove-extra-white-space-spaces-from-data/ Share on other sites More sharing options...
Ken2k7 Posted May 5, 2009 Share Posted May 5, 2009 You can use trim but you should find the source of the problem instead. Link to comment https://forums.phpfreaks.com/topic/157004-remove-extra-white-space-spaces-from-data/#findComment-827071 Share on other sites More sharing options...
stig1 Posted May 5, 2009 Author Share Posted May 5, 2009 The problem of the source has already been located. Data on an IBM AS400 system, puts in all the extra spaces in lines especially when the AS400 programmer, wants to put data in a text field to display, on his screen, the data will have spaces cause he can't do carriage returns or something. Not going to argue with him. It has to do with characters per line in an as400 system. I can use trim for so many fields, but the one i explained is a text field, and just looks very ugly in my mysql database. Link to comment https://forums.phpfreaks.com/topic/157004-remove-extra-white-space-spaces-from-data/#findComment-827078 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.