Warning: file_get_contents(/data/phpspider/zhask/data//catemap/8/mysql/68.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Html 将mysql结果(编号)转换为其他内容_Html_Mysql_For Loop_While Loop - Fatal编程技术网

Html 将mysql结果(编号)转换为其他内容

Html 将mysql结果(编号)转换为其他内容,html,mysql,for-loop,while-loop,Html,Mysql,For Loop,While Loop,我正在搜索一个将字符串值从MySQL请求转换为其他内容的方法 这是HTML: <p class="secondaire"> <i class="material-icons">lens</i> <i class="material-icons">lens</i> <i class="material-icons">lens</i> <i class="material-ico

我正在搜索一个将字符串值从MySQL请求转换为其他内容的方法

这是HTML:

<p class="secondaire">
    <i class="material-icons">lens</i>
    <i class="material-icons">lens</i>
    <i class="material-icons">lens</i>
    <i class="material-icons">radio_button_unchecked</i>
    <i class="material-icons">radio_button_unchecked</i>
</p>

透镜 透镜 透镜 单选按钮未选中 单选按钮未选中

我的数据库中有一个字符串值,例如4。我想这样做:

在我的数据库中显示与我的字符串值相关的4个图标


我不知道怎么做。我尝试了
for
while
循环,但没有一个循环显示我想要的内容。

类似的内容

echo '<p class="secondaire">';

for($i=0;$i<intval($mysql_result_string);$i++){
    echo '<i class="material-icons">lens</i>';
}

echo '</p>';
echo'


对于($i=0;$i)它有很多优点!我不知道intval中的这个函数!再次感谢您