This is the data currently located in one column:
"Title Info - Company Here - City Here, ST"
ST represents state ie GA
Sometimes my data looks like this:
"Title Info - Company Here - United States"
Data is on column named "title" and is without quotes.
How do I split this using php, for 4 new columns named:
"New_Title", "Company", "City", "State"
On second example where there is no city and state just country, it would be ok to go to "city" column.
Table schema:
CREATE TABLE table (
id int(8) NOT NULL DEFAULT '0',
Title char(100) DEFAULT NULL,
New_Title char(100) DEFAULT NULL,
Company char(100) DEFAULT NULL,
City char(100) DEFAULT NULL,
State char(100) DEFAULT NULL,
PRIMARY KEY (id)
)
ENGINE=MyISAM DEFAULT CHARSET=latin1;
Thanks for your time.
Ossi