我创建了一个PHP页面,它应该从数据库中选择两个名称并显示它们.

它只是说:

Warning: mysqli_query() expects at least 2 parameters, 1 given in /home/tdoylex1/public_html/dorkhub/index.php on line 4

Warning: mysqli_query() expects at least 2 parameters, 1 given in /home/tdoylex1/public_html/dorkhub/index.php on line 8

我的代码是:

$name1 = mysqli_query("SELECT name1 FROM users

ORDER BY RAND()

LIMIT 1");

$name2 = mysqli_query("SELECT name FROM users

ORDER BY RAND()

LIMIT 1");

?>

DorkHub. The online name-rating website.

DorkHub. The online name-rating website.

<?php echo $name1; ?>

against

<?php echo $name1; ?>

Who's sounds the dorkiest?

VOTE FOR FIRST

VOTE FOR LAST

Logo

腾讯云面向开发者汇聚海量精品云计算使用和开发经验,营造开放的云计算技术生态圈。

更多推荐