Hello
I need help to get out the right value from my while code.
The thing is now that i only get out the last value in the last preg_replace.
I allways get the last value from my mysql_query on
$fd_link['regid'];
$fd_link['username'];
but if i put
$fd_link['regid'];
$fd_link['username'];
in the while loop everthing work i get out the righ values
but if i put the last preg_replace in the while loop nothing happends
<?php
preg_match_all('#\[fd\](.*?)\[/fd\]#is', $new_text['ptn'], $matches);
while(list($usernum, $user) = each($matches[1])) {
$result = mysql_query("SELECT username,regid FROM reg_info WHERE username='$user'",$starta);
$fd_link = mysql_fetch_assoc($result);
}
$new_text['ptn'] = preg_replace("#\[fd\](.*?)\[/fd\]#is", "<a href=\"../../midle/user/usersite.php?usernameID=".$fd_link['regid']."\">".$fd_link['username']."</a>", $new_text['ptn']);
?>