Grazie ancora,
ma il mio problema è un'altro...
Ti posto il codice esattamente per come è.
Avendo nella $db_table1 2 campi (id e nome):
1 | utente1
2 | utente2
3 | utente3

e nella $db_table2 3 campi (id,nome,campo)

1 | ProdottoA | -2(50|17/10/2005+17:18|)--1(50|17/10/2005+17:17|)-
2 | ProdottoB | -2(50|17/10/2005+17:38|)--3(50|17/10/2005+17:30|)-

facendo:
codice:
$query_u = mysql_query("SELECT * FROM $db_table1 order by cognome");
while($u = mysql_fetch_array($query_u)) {
$id=$u['id'];
$query_pu = mysql_query("SELECT id,nome,campo FROM $db_table where campo LIKE '%-$id(%)-%'");
while($voce = mysql_fetch_array($query_pu)) {
$testo=$voce['campo'];
if(preg_match_all('#'.$id.'\((.+?)\)#si', $testo, $results)) {
echo "$id - ".$u['nome']." - ".$voce['id']." - ".$voce['nome']." - ".substr(implode("xxxxxxxxxxxxx", $results[1]), 0, -18).",00";
}
}
}
Il risultato è:

1 - utente1 - 1 - Prodotto A - 50
3 - utente3 - 2 - Prodotto B - 50
2 - utente2 - 1 - Prodotto A - 50
2 - utente2 - 2 - Prodotto B - 50

è cosi funziona per come dovrebbe!
Il problema è che quando la $db_table2 è così:

1 | ProdottoA | -2(50|17/10/2005+17:18|)--2(50|17/10/2005+17:17|)-
2 | ProdottoB | -2(50|17/10/2005+17:38|)--2(50|17/10/2005+17:30|)-

il sistema si impalla è mi risponde così:

2 - utente2 - 1 - Prodotto A - 50|17/10/2005+17:18|xxxxxxxxxxxxx50
2 - utente2 - 2 - Prodotto B - 50|17/10/2005+17:38|xxxxxxxxxxxxx50

invece che rispondermi così:

2 - utente2 - 1 - Prodotto A - 50
2 - utente2 - 2 - Prodotto B - 50

Come risolvo?