while($testing = mysqli_fetch_array($sendPasswordQuery)){
echo "'$testing['name']'";
}
嗨,我知道第二行是错误的,但是我如何打印名称列。提前致谢。
最佳答案
您的第二行需要采用以下格式之一:
echo $testing['name']; // will output Name directly
echo "'{$testing['name']}'"; // will output 'Name' inside a string
echo "'$testing[name]'"; // will output 'Name' in a string,
// however the second example is better practice.
如果您只是回显该变量而不向其添加任何额外的文本,只需使用:
echo $testing['name'];
否则,我建议如下:
echo "Lorem ipsum {$testing['name']} sit amet.";
这将输出:Lorem ipsum Name sat amet。
关于php - 如何打印 mysqli_fetch_array 变量,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/22314755/