function setCurrentBlock($BlockName)
{
$query = mysql_query("SELECT `username`, `tplusr`, `message`, `tplmsg`, `block` FROM `guestMVC`") or die(mysql_error());
$blck = preg_match_all("/(?:\{$BlockName\})([\D]+)(?:\{\/$BlockName\})/u", $this->html, $blk);
foreach($blk[1] as $ss=>$qq)
while($sql = mysql_fetch_assoc($query))
{
$this->html = str_replace($blk[0], $blk[1], $this->html);
$bb = str_replace($sql['tplusr'], $sql['username'], $blk[1]);
$qqq = str_replace($sql['tplmsg'], $sql['message'], $bb);
$this->html = str_replace($blk[1], $qqq, $this->html);
}
//qqq - имеет вид
array[0](
Имя : *****
Комментарий: ****)
array[0](
Имя : *****
Комментарий: ****)
...........
$blk[1] - имеет вид
Имя : {USERNAME}
Комментарий: {USERCOMMENT}
}
Подскажите как вывести все комментарии? Или как правильно выполнить задуманное мною?