SkyRanger Posted June 9, 2019 Share Posted June 9, 2019 Not sure if possible, been doing a google search to try to find the answer. If somebody can directly me to location where I can figure out how to do this if it is possible. What I am trying to do is pull information from a text area and each line inserts in to separate row in mysql. ex textarea contains: email1@email.tld email2@email.tld email3@email.tld I am trying to figure out how to put each address in to separate row in table. Quote Link to comment Share on other sites More sharing options...
maxxd Posted June 9, 2019 Share Posted June 9, 2019 Explode the string on newline and you'll have an array of emails which you can loop through to insert. You may want to run additional checks for commas and/or whitespace just in case your users don't read the instructions. Quote Link to comment Share on other sites More sharing options...
SkyRanger Posted June 9, 2019 Author Share Posted June 9, 2019 Perfect thanks maxxd Quote Link to comment Share on other sites More sharing options...
Barand Posted June 9, 2019 Share Posted June 9, 2019 A better solution is to stop using text areas for data input (other than for blocks of text that are to be treated as blocks of text) and to use separate input fields for each separate pice of data. Quote Link to comment Share on other sites More sharing options...
SkyRanger Posted June 9, 2019 Author Share Posted June 9, 2019 I have gotten the textarea entry to work but yeah Barand I am going to need to change over to separate fields and use jquery to do the code as I need an extra field per row to be inserted. 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.