我用sql查询得到一个空结果
$sql = "SELECT * FROM $tbl_name ORDER BY performanta_cpu DESC LIMIT";
<select name="intern_memorie" id="intern_memorie"/>
<?php
foreach ($dbh->query($sql) as $linie)
{
print '<option value="'.$linie["performanta_cpu"].'">'.$linie["performanta_cpu"].'</option>'; }
几天前相同的代码工作!
答案 0 :(得分:3)
您忘了设置LIMIT
因此,您的正确查询为$sql = "SELECT * FROM $tbl_name ORDER BY performanta_cpu DESC LIMIT 10";
或代替10个任意数字。