i have a table(tbl1) that has a column containing email addresses which are
in the format mailto:person@domain.com?subject= blah.
This table isnt related to any other tables in my database. I would like to
be able to relate it by creating another column that contains only the email
part of the address eg person@domain.com (notice the absence of the mailto:
and subject?= blah).
One of my tables (tbl2)has a column containing email addresses in the
person@domain.com .
I am thinking that if i can find a way of updating tb1 so that it contains
duplicate info similar to that of tbl2 that i could then relate the tables
and use them in my queries.
I have looked through the php manual and thought that i might be able to use
strstr()
eg $email = 'mailto:person@domain.com?subject= blah';
$domain = strstr($email, ':');
print $domain; // prints :person@domain.com?subject= blah
I have three problems with this
- it doesnt really serve my purpose because the : would be at the front of
every address as would be the ?subject= blah
2 this php approach seems almost like overkill in that there should be an
easier sql or combined alternative
3.I know that concat works in sql queries. Is there a deconcat function that
I could use
eg deconcat $string
a simplified verison of what i need is something along the lines of
update tb1 set column2 = deconcat('mailto:',column1,'?subject= blah')
hope you people understand what i mean please ask if you need any
clarification
R