我正在尝试将数据放入MySQL表中,但我收到以下错误消息之一:
Warning: mysqli_query(): Empty query in /websites/123reg/LinuxPackage22/ng/it/_o/ngit.org.uk/public_html/applicationform.php on line 70
这就是我的代码的样子:
$myconnection = mysqli_connect('cust-mysql-123-20','register','London2014');
mysqli_select_db($myconnection,$register );
$query_Recordset1 = "SELECT * FROM `application`";
$Recordset1 = mysqli_query($myconnection, $register) or die(mysql_error());
$row_Recordset1 = mysql_fetch_assoc($Recordset1);
$totalRows_Recordset1 = mysql_num_rows($Recordset1);
这是第70行:
$Recordset1 = mysqli_query($myconnection, $register) or die(mysql_error());
请帮助。
答案 0 :(得分:2)
您的查询包含在名为$query_Recordset1
而非$register
的变量中。你还混合了mysqli和mysql函数:
$myconnection = mysqli_connect('xxxxxxxx','xxxxxx','xxxxxx');
mysqli_select_db($myconnection,$register );
$query_Recordset1 = "SELECT * FROM `application`";
$Recordset1 = mysqli_query($myconnection, $query_Recordset1 ) or die(mysqli_error($myconnection));
$row_Recordset1 = mysqli_fetch_assoc($Recordset1);
$totalRows_Recordset1 = mysqli_num_rows($Recordset1);
仅供参考,如果这是您的真实登录名和密码,则需要更改现在。