2010-01-19 4 views
0

.tpl유식 보내기 쿼리

{section name=i loop=$view} 
{$view[i].newvalue} 
{/section} 

에서

while ($line = mysql_fetch_assoc($result)){ 
$value[] = $line; 
$value['newvalue'] ='223457'; 
} 
$smarty->assign('view', $value); 

.PHP에서 유식의 newvalue.im 초보자를위한 출력이

답변

1

당신은 어쨌든 ... 어쩌면, 가지 가까이하지 이것이 당신이 원하는 것입니다. 사람들이 읽을 수 있도록 코드를 들여 씁니다. .tpl에서

$c=0; 
while ($line = mysql_fetch_assoc($result)){ 
    $value[$c] = $line; 
    $value[$c]['newvalue'] ='223457'; 
    $c++; 
} 
$smarty->assign('view', $value); 

:

{foreach item=v from $view} 
    {$v.newvalue} 
{/foreach}