求准确写法
求正确写法直接看代码:PHP codewhile ($rowmysql_fetch_row($result)){for ($i0 $imysql_num_fields($
求正确写法
直接看代码:
PHP code 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>'; } }
谢谢
[解决办法]echo "<a href='../products/index.php?pclass=$row[$i]'>";
[解决办法]Note: 不像双引号 和heredoc语法结构, 在单引号字符串中的变量 和特殊含义的字符将 不会 被替换。
http://www.php.net/manual/zh/language.types.string.php
[解决办法] echo "<a href='../products/index.php?pclass={$row[$i]}'>";