警告:mysqli_query()至少需要2個(gè)參數(shù),其中1個(gè)給定。什么?我創(chuàng)建了一個(gè)PHP頁(yè)面,該頁(yè)面應(yīng)該從數(shù)據(jù)庫(kù)中選擇兩個(gè)名稱并顯示它們。它只是說(shuō):Warning: mysqli_query() expects at least 2 parameters, 1 given in /home/tdoylex1/public_html/dorkhub/index.php on line 4Warning: mysqli_query() expects at least 2 parameters, 1 given in /home/tdoylex1/public_html/dorkhub/index.php on line 8我的代碼是:<?php mysqli_connect(localhost,tdoylex1_dork,dorkk,tdoylex1_dork);$name1 = mysqli_query("SELECT name1 FROM users
ORDER BY RAND()
LIMIT 1");$name2 = mysqli_query("SELECT name FROM users
ORDER BY RAND()
LIMIT 1");?><title>DorkHub. The online name-rating website.</title><link rel="stylesheet" type="text/css" href="style.css"><body bgcolor='EAEAEA'><center><div id='TITLE'>
<h2>DorkHub. The online name-rating website.</h2></div>
<p>
<br>
<h3><?php echo $name1; ?></h3><h4> against </h4><h3><?php echo $name1; ?></h3>
<br><br>
<h2 style='font-family:Arial, Helvetica, sans-serif;'>Who's sounds the dorkiest?</h2>
<br><br>
<div id='vote'>
<h3 id='done' style='margin-right: 10px'>VOTE FOR FIRST</h3><h3 id='done'>VOTE FOR LAST</h3>
警告:mysqli_query()至少需要2個(gè)參數(shù),其中1個(gè)給定。什么?
慕尼黑8549860
2019-06-29 11:14:48