By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
432,009 Members | 1,487 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 432,009 IT Pros & Developers. It's quick & easy.

php/mysql replace

P: n/a
Hy
First sorry for my terreble english.
How do i remove first 3 words in field "post". I nead to remove first 3
words i all the records.
In every new record legnth of the words are different.

My table structure looks like this
`ID` bigint(21) NOT NULL auto_increment,
`title` varchar(60) NOT NULL default '',
`author` bigint(20) NOT NULL default '0',
`telapsed` bigint(21) NOT NULL default '0',
`timepost` varchar(100) NOT NULL default '',
`numreplies` int(10) NOT NULL default '0',
`post` longtext NOT NULL,
`threadparent` bigint(21) NOT NULL default '0',
`lastpost` varchar(255) NOT NULL default '',
`postforum` bigint(20) NOT NULL default '0',
`views` bigint(20) NOT NULL default '0',
`nosmilies` int(11) NOT NULL default '0',
`value` int(11) NOT NULL default '0',
`ipaddress` varchar(255) NOT NULL default '',
`locked` int(11) NOT NULL default '0',
`zupanija` varchar(100) NOT NULL default '',
`opcina` varchar(100) NOT NULL default '',
`kategorija` varchar(100) NOT NULL default '',
PRIMARY KEY (`ID`)
sample record:

'1', 'This', '5', '1064850845', '2007/05/20 15:26:19', '0',
'word1 word2 word3 This is test message', '0', '', '1', '1', '1',
'0', '1234566', '0', '051', 'Rogla', 'Kat1'
Tnx in advance on your time
Dejan

May 22 '07 #1
Share this Question
Share on Google+
1 Reply


P: n/a
Master_Di wrote:
Hy
First sorry for my terreble english.
How do i remove first 3 words in field "post". I nead to remove first 3
words i all the records.
In every new record legnth of the words are different.

My table structure looks like this
`ID` bigint(21) NOT NULL auto_increment,
`title` varchar(60) NOT NULL default '',
`author` bigint(20) NOT NULL default '0',
`telapsed` bigint(21) NOT NULL default '0',
`timepost` varchar(100) NOT NULL default '',
`numreplies` int(10) NOT NULL default '0',
`post` longtext NOT NULL,
`threadparent` bigint(21) NOT NULL default '0',
`lastpost` varchar(255) NOT NULL default '',
`postforum` bigint(20) NOT NULL default '0',
`views` bigint(20) NOT NULL default '0',
`nosmilies` int(11) NOT NULL default '0',
`value` int(11) NOT NULL default '0',
`ipaddress` varchar(255) NOT NULL default '',
`locked` int(11) NOT NULL default '0',
`zupanija` varchar(100) NOT NULL default '',
`opcina` varchar(100) NOT NULL default '',
`kategorija` varchar(100) NOT NULL default '',
PRIMARY KEY (`ID`)
sample record:

'1', 'This', '5', '1064850845', '2007/05/20 15:26:19', '0',
'word1 word2 word3 This is test message', '0', '', '1', '1', '1',
'0', '1234566', '0', '051', 'Rogla', 'Kat1'
Tnx in advance on your time
Dejan
You should ask in comp.databases.mysql. You probably can find a SQL
solution for it.

Otherwise, read each row in, delete the first three words with any of a
number of PHP functions and update the row.

--
==================
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
js*******@attglobal.net
==================
May 22 '07 #2

This discussion thread is closed

Replies have been disabled for this discussion.