我想知道我如何用mysqli做这个,我需要拉出列名userKey并将其回显到一个变量我试图寻找如何做到但我无法找到任何东西,如果有人可以帮助它会很棒!
答案 0 :(得分:0)
使用php mysqli:
$query=mysqli_query($dbconnect,"SELECT userKey FROM table ORDER BY RAND() LIMIT 10")or die("Error: ".mysqli_error($dbconect));
while($row=mysqli_fetch_array($query))
{
echo $row['userKey'];
}
//you can change the limit in the mysqli
代码未检查fyi