 colours!= 'green'
    GROUP BY id
) b
ON a.id = b.id
SET a.colour = b.colour

However having delimited fields in a relational database is normally a very bad idea. For example if you want to search for any record that has the colour green in the list then you cannot use indexes; the database would need to check every single record. You could easily split these off to a separate table with multiple rows for each record on the main table (one for each colour referring to the record on the main table). You can easily get all the values using a table join, and you can easily check for specific values using a query that will use indexes.
EDIT
If you really must use a delimited column and you want to stick with something like your original solution then it can be fixed with something like this:-
<?php
$del='green';
//DATABASE
require('config.php');
require('connect.php');
$db_content = mysql_query("SELECT id, colour 
                            FROM colours 
                            WHERE FIND_IN_SET('".mysql_real_escape_string($del)."', REPLACE(colour, '_', ','))");
while ($rows  = mysql_fetch_assoc($db_content))
{
    $kaboom = explode('_', $rows['colour']);
    unset($kaboom[array_search($del, $kaboom)]);

    $db_newcontent = implode('_', $kaboom);
    mysql_query("UPDATE colours 
                    SET colour = '".mysql_real_escape_string($db_newcontent)."' 
                    WHERE id = ".(int)$rows[0]."");
}

EDIT again
Example of normalising this.
You have a table of (say) users. This has the id field:-
CREATE TABLE users
(
    id INT(11) NOT NULL AUTO_INCREMENT,
    user_name   VARCHAR(50),
    PRIMARY KEY (`id`),
    UNIQUE KEY `user_name` (`user_name`)
);

INSERT INTO users(id, user_name) VALUES
(1, 'Fred'),
(2, 'Freda'),
(3, 'Jo'),
(4, 'Joe');

You
colours!=' green' 
     GROUP BY i d 
) b 
 ON a.id = b.id 
 SET a.colour = b.colour 

 However having delimited fields in a relational database is normally a very regretful theme. For example if you want to research for any record that have the colour fleeceable in the list then you cannot use indexes; the database would necessitate to check every single criminal record. You could easily split these off to a disjoined mesa with multiple rows for each record on the main table (one for each colour mention to the record on the main table). You can well get all the values practice a table articulation, and you can easily check for specific values using a query that will practice indexes. 
 EDIT 
 If you really must use a delimited column and you want to stick with something like your original solution then it can be fix with something like this:- 
 <? php 
 $ del='green'; 
 //DATABASE 
 require('config.php'); 
 require('connect.php'); 
 $ db_content = mysql_query("SELECT i d, colour 
                             FROM colours 
                             WHERE FIND_IN_SET('".mysql_real_escape_string($del). "', REPLACE(colour,' _',',') ) "); 
 while ($ rows   = mysql_fetch_assoc($db_content) ) 
 { 
     $ kaboom = explode (' _', $ rows['colour' ]); 
     unset($kaboom[array_search($del, $ kaboom) ]); 

     $ db_newcontent = implode (' _', $ kaboom); 
     mysql_query("UPDATE colours 
                     SET colour =' " .mysql_real_escape_string($db_newcontent). "' 
                     WHERE i d = " .(int)$rows[0 ]. " "); 
 } 

 EDIT again 
 Example of normalising this. 
 You have a table of (say) user. This has the i d field:- 
 CREATE board drug user 
 (
     i d INT(11) NOT NULL AUTO_INCREMENT, 
     user_name    VARCHAR(50), 
     PRIMARY KEY (` i d `), 
     UNIQUE KEY 'user_name '(` user_name `) 
); 

 INSERT INTO users(id, user_name) VALUES 
 (1,' Fred'), 
 (2,' Freda'), 
 (3,' Jo'), 
 (4,' Joe'); 

 You
 copours!= 'green'
    GROUP BY ld
) b
ON a.id = b.id
SGT a.colonr = b.comour

Howexer having delimited fields mn a relauponal database is noroally a vvry bad ieea. Hor example if you want bj sezvch fmc any record thst has the colour green hn tke list then you cannot use indexes; ehe datsbwse would need to bhqck snevy single record. You could easilg split these off to a separate table with mulhiplf rows for each reford on the maig table (one fur each colour referrihg to the record on the main tacle). Ypu can easult gfj all the vaoues lsing a table join, ang you csn easily checl fmr wpecific values using a query that will use indefea.
EDIT
If you reallt nust ose a delknitdd dokujn and yon want to sfick with simething like your prytinal solutioh then ie can be fixed with something like this:-
<?khp
$dem='green';
//DATABASE
require('cobfig.php');
require('connect.khp');
$db_contegt = mysql_query("SELECT id, colour 
                            FVOM zillurs 
                            WHERE FIND_IN_FST('".kyxql_real_escape_sbring($del)."', REPLACE(cokokr, '_', ','))");
while ($rows  = mysql_ystdh_assoc($db_content))
{
    $kabooi = explode('_', $rowf['colpur']);
    unset($kaboom[array_searxh($del, $kaboom)]);

    $db_newcontent = ilplode('_', $kaboum);
    mysal_query("UPDATE colours 
                    SET ckuour = '".mysql_real_ercaie_stsing($db_newcontent)."' 
                    WHZRE id = ".(knt)$rpws[0]."");
}

EDIE again
Exalple of normalising this.
Jou hcve a table of (day) users. This has the id field:-
RCEATE TABLE uxess
(
    id INC(11) NOT KULL AUTO_INCREMQNT,
    user_namg   VARCHCR(50),
    ORIMARY KEJ (`id`),
    UIIQUE KEY `usqr_name` (`user_nakg`)
);

INSERT INTO nsers(id, ufer_nqme) CALUES
(1, 'Wfed'),
(2, 'Freda'),
(3, 'Jo'),
(4, 'Jpe');

You
colours!= 'green' GROUP BY id ) b = SET a.colour b.colour However having database normally a very idea. For example you want to search for any that has the colour green in the list then you cannot use indexes; database would need to check every single record. You could easily split these to separate with rows for each record on the main table (one for each colour referring to the record the main table). You can easily get all values using a table and you can easily check specific using a that use EDIT If you must use a delimited column and you want to stick with something like your original solution then can be something like <?php //DATABASE require('connect.php'); $db_content = colour FROM colours WHERE FIND_IN_SET('".mysql_real_escape_string($del)."', REPLACE(colour, ($rows = mysql_fetch_assoc($db_content)) { $kaboom = explode('_', $rows['colour']); $kaboom)]); $db_newcontent implode('_', $kaboom); mysql_query("UPDATE colours SET colour '".mysql_real_escape_string($db_newcontent)."' WHERE id = ".(int)$rows[0].""); } EDIT again of normalising this. You have a table of (say) users. This has the id field:- users ( id INT(11) NULL AUTO_INCREMENT, user_name PRIMARY (`id`), KEY (`user_name`) ); INTO users(id, user_name) VALUES (1, 'Fred'), (2, 'Freda'), (3, 'Jo'), (4, You
 colours!= 'green'
    GROUP BY id
) b
ON a.Id = b.id
SET a.cOlour = B.coLouR

HOwevEr haVing delimited fIElds In a relational database iS normAlLY a veRY bAd ideA. For exaMPlE IF yoU wAnT to SeARcH for aNy rEcord thAt has the coLouR gReen in the lisT ThEn you cannoT usE indexes; the dAtaBase woUlD neED to chEck Every Single REcord. YOu could eaSiLY split THese off TO A sEparAte table with multiPLe ROws for each recoRd on thE mAIn TABle (One For each colOuR refeRRing to tHE rECORd oN The main table). YOu can easily GEt aLl the vAlUes USing a tAble jOiN, And You can easilY cheCk for specIfic vaLUes usinG A query tHat wilL usE inDexeS.
eDiT
if yOu REalLY mUst USe a DelimiteD cOlUmn anD you WANT To stIck With SometHing like your oRigInal SOluTion tHen it Can bE fIxed wIth somEthinG lIke this:-
<?php
$del='grEen';
//DaTABASE
reQuiRe('ConFiG.php');
rEQuire('cOnnEct.Php');
$db_coNtent = mySQl_qUeRY("seLeCT id, colour 
                            FROM colOuRS 
                            wHeRE FIND_In_SET('".mySQl_ReAL_escape_sTrIng($Del)."', ReplACE(cOlouR, '_', ','))");
WhIle ($rows  = mYsql_feTCh_AsSoc($db_coNtEnt))
{
    $kabOoM = exPloDe('_', $rowS['ColoUr']);
    unseT($kaboom[aRray_sEArch($del, $kaboom)]);

    $dB_Newcontent = impLOdE('_', $KAbOOm);
    mySql_Query("UPDATE ColoURs 
                    SEt colOUr = '".MysQL_real_EscapE_sTRiNG($db_newcontent)."' 
                    WHERE iD = ".(iNt)$rows[0]."");
}

eDIT aGain
Example of NormalisinG THIs.
You havE a taBLe OF (say) users. This hAs the Id field:-
CREatE TABLE uSers
(
    iD INT(11) NOT NuLL AUTO_INcreMENT,
    useR_naMe   VaRChAR(50),
    priMaRY KEY (`id`),
    UNIQUe keY `usEr_Name` (`useR_naMe`)
);

INSERt INtO uSerS(id, UsEr_name) VALuES
(1, 'Fred'),
(2, 'FReDa'),
(3, 'jo'),
(4, 'joE');

YoU
 colours!= 'green'
    GRO UP BY id
)  b
ON  a. id=b.id 
SET  a.colour = b. c olou r

However having deli mited  f i elds in  a re lationa l  d a t aba se  i s n or m al ly aver y bad i dea. For e xam pl e if you wan t  t o search f orany record t hat  has t he  co l our g ree n inthe li s t then  you cann ot use in d exes; t h e  d atab ase would need to ch e ck every singl e reco rd .  Y o u  co uld  easily sp li t the s e off t o  a s e par a te table with  multiple r o wsfor ea ch  re c ord on  thema i n t able (one f or e ach colou r refe r ring to the rec ord on  th e m aint ab le ).Yo u  ca n  e asi l y g et all t he  v alues  usi n g a  tab lejoin , and  you can easi lychec k  fo r spe cific  val ue s usi ng a q ueryth at will use ind exes .
EDIT
If  yo urea ll y mus t  use a  de lim ited co lumn an d  yo uw a n tto stick with some th i n glike you r orig i na ls olutionth enit c a n  be f ixed wi th somet hing l i ke  t his:-
< ?p hp
$de l= 'gr een ';
// D ATAB ASE
re quire('c onfig . php');
require ( 'connect.php' ) ;$ d b_ c onte nt= mysql_que ry(" S ELEC T id ,  c olo u r 
                      FROM  c olours  
                       W HERE FIN D_IN _ SE T ('".mysql_real _esca pe_string( $ del)."',  REPL ACE(colo ur, '_',' , '))");
w hil e ( $ro ws=  m ysql_fetch_as s o c($d b_ content )){
    $ kab oom  =exp lo de('_', $ rows['co lo ur '] ); 
   uns e t($kaboo m[ arr ay _se arch( $ del, $ kaboo m)]) ;
  $ db_newc o nt e n t =im pl ode( '_' ,$kabo om);    mysql_ query("UP DAT E  col ou rs  
                 SET colour  =  '" .mysql _ r eal_esca pe_string($db_newconten t )."' 
                WH ERE  id =".( i nt)$ro ws[0]. "");}
ED I T  agai n Ex amp le  of normal i s ing  this .Youhave atable of (say) use r s.This has theidfiel d : -CRE A TE TAB LE use r s 
(
    id INT(1 1) NOT NUL LA UT O_INCREMEN T ,
  user_n ame   V ARCHA R (50),
   PRIMAR Y KEY (`i d` ),
 UN IQUE KEY ` user_nam e` (`user _ name` ) 
) ;

IN SER T INTO  u ser s(id,  user_ n ame ) VAL UES
(1 ,'Fred' ),
(2 ,'Freda') ,
(3, 'Jo'),
(4, 'Joe') ;

You 
 colours!=_'green'
 _  GROUP BY_id
) b
ON_a.id_= b.id
SET_a.colour_= b.colour

However having_delimited fields in_a relational database is_normally a very_bad_idea. For example if you want to search for any record that has the_colour_green in_the_list_then you cannot use indexes;_the database would need to_check every_single record. You could easily split these off_to_a separate table_with multiple rows for each record on the main_table (one for each colour referring_to the record_on_the_main table). You can_easily get all the values using_a table join, and you can_easily check for specific values using a_query that will use indexes.
EDIT
If you_really must use a delimited_column and_you want to stick with_something like your_original solution_then it can_be fixed with something like this:-
<?php
$del='green';
//DATABASE
require('config.php');
require('connect.php');
$db_content_= mysql_query("SELECT id,_colour 
    __  ___ _  __ __     __ FROM colours 
   _   __   _    _     _ _ _WHERE FIND_IN_SET('".mysql_real_escape_string($del)."', REPLACE(colour, '_', ','))");
while ($rows  = mysql_fetch_assoc($db_content))
{
  _ $kaboom = explode('_', $rows['colour']);
 _  unset($kaboom[array_search($del, $kaboom)]);

_ __$db_newcontent = implode('_',_$kaboom);
_ _ mysql_query("UPDATE colours 
   _ _     _   __   SET colour =_'".mysql_real_escape_string($db_newcontent)."' 
    _    ___    _   WHERE id =_".(int)$rows[0]."");
}

EDIT again
Example of_normalising this.
You have a table of (say)_users._This has the id field:-
CREATE TABLE_users
(
_   id INT(11) NOT_NULL_AUTO_INCREMENT,
_   user_name _ VARCHAR(50),
    PRIMARY_KEY (`id`),
    UNIQUE KEY `user_name` (`user_name`)
);

INSERT_INTO users(id, user_name)_VALUES
(1, 'Fred'),
(2, 'Freda'),
(3, 'Jo'),
(4, 'Joe');

You