Modify a value in MYSQL field with multiple values(complicated)
===

Table 1 - users<br>
id username items<br>
1 Paul 1(0020);2(0001);<br>
Table 2 - items<br>
id name <br>
1 name_here<br>

    

In my user`s items i put 2(0001) wich emans: 2=item id, 0001 is the amount of it
Here is a function that displays my item list



    function getitems() {
    $username = $_SESSION['user'];
    $connect = mysql_connect("localhost","root","x") or die("Conexiune nereusita!");
    mysql_select_db("skameron") or die("Baza de date nu exista!");
	$query = mysql_query("SELECT * FROM users WHERE username='" . $username . "'") or            die(mysql_error());
	if(mysql_num_rows($query) == 0) {
			echo "<tr><td colspan=\"3\">Nu ai iteme in inventar!</td></tr>";
	} else {
			while($itm = mysql_fetch_assoc($query)) {
		$str = $itm['items'];
		$items = preg_split("/;/", $str); 
		foreach ($items as $item){ 
     
    $temp_item =  preg_split("/,/", $item); 
    if($temp_item){ 
        foreach ($temp_item as $temp_i){ 
		If($temp_i=="")
		{
		}
		else{
		$pieces = substr($temp_i, -5, 4);
		$piecesold = $pieces;
		$pieces = $pieces/1;
		//$arrnr = array(0,1,2,3,4,5,6,7,8,9,"(",")");
		//$temp_i = str_replace($arrnr,"",$temp_i);
		$query2 = mysql_query("SELECT * FROM items WHERE id='" . $temp_i . "'") or die(mysql_error());
			if(mysql_num_rows($query2) == 0) {
			echo "<tr><td colspan=\"3\">Nu ai iteme in inventar!</td></tr>";
	} else {
			while($itm2 = mysql_fetch_assoc($query2)) {
			$temp_i = $itm2['name'];
			$temp_id = $itm2['id'];
            echo $temp_i . " <a href='items.php?del=". $temp_id."(".$piecesold.")'>Delete all</a>(". $pieces . ")/<a href='items.php?del=". $temp_id."(".$piecesold.")&nr=1'>Delete 1</a><br>"; 
		}}}}} else { 
        echo $item;     
    }}}}}




I made the page to delete an item but i can`t find a way to delete just the amount of items...for example to change this: 2(0100);1(0001); to this: 2(0099);1(0001);


Here is how i did to delete a value like this...
$delitem = $_GET['del'];
$queryreg = mysql_query("UPDATE users SET items = REPLACE(items, '$delitem;', '');");

I can delete with this page a value like 2(0099); and the others remain...
But i can`t onli change the amount of item wich is 0099/1=99

I hope you can understand me what shit i did there and help me because i`m stuck for 3 hours:))))