怎样把php查询结果 存入一个变量里

2025-04-05 00:44:02
推荐回答(1个)
回答1:

//循环
$_str="";
while($row = mysql_fetch_row($result))
{
$_str .=<<

  • {$row[0]}{$row[1]}

  • doc;
    }

    这样就可以了,你在模板里直接print $_str;就行了

    <<
    doc;后面被百度加了个空格,自己删掉