直接看代码:    while ($row=mysql_fetch_row($result))
    {
      for ($i=0; $i<mysql_num_fields($result); $i++ )
      {
        echo '<a href="../products/index.php?pclass=$row[$i]">';//这一行,plass=后面应该怎么写才符合规范?
        echo "$row[$i]";
        echo '</a>';
      }
    }谢谢

解决方案 »

  1.   

    echo "<a href='../products/index.php?pclass=$row[$i]'>";
      

  2.   

    echo '<a href="../products/showclass.php?pclass=.$row[$i].">';不行echo '<a href="../products/showclass.php?pclass='$row[$i]'">';也不行换大括号,还是不行
      

  3.   

    Note: 不像双引号 和heredoc语法结构, 在单引号字符串中的变量 和特殊含义的字符将 不会 被替换。
    http://www.php.net/manual/zh/language.types.string.php
      

  4.   

     echo "<a href='../products/index.php?pclass={$row[$i]}'>";