If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > Database Server Software > MySQL > Parsing data

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 02-17-11, 19:31
oldnickj oldnickj is offline
Registered User
 
Join Date: Jan 2009
Posts: 103
Parsing data

I have a number of names & email addresses being entered in one field in a form. I want to create a separate record for each set. Is there a way in SQL to do this or does this need to happen on PHP?

e.g. "Jxxx Jxxxx" <jxxx@yahoo.com>, "Nyyy Jyyyy" <yyy@yyy.com>, "Nzzz Jzzz" <zzz@zzz.org>, "Wwww Awww" <www@www.com>

into a table like:

_____________________
id |name | email
_____________________
1 |Jxxx Jxxxx |<jxxx@yahoo.com>
_____________________
2 |Nyyy Jyyyy|<yyy@yyy.com>

Nick
Reply With Quote
  #2 (permalink)  
Old 02-18-11, 03:27
r937 r937 is online now
SQL Consultant
 
Join Date: Apr 2002
Location: Toronto, Canada
Posts: 19,535
much easier if you do it with php -- the sql solution is quite messy
__________________
r937.com | rudy.ca
please visit Simply SQL and buy my book
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On