PHP DELETE
$bid=$_GET['bid'];$roll_id=$_GET['roll_id'];$conn=mysqli_connect('localhost','root','...
$bid = $_GET['bid'];
$roll_id = $_GET['roll_id'];
$conn = mysqli_connect('localhost', 'root', 'root', 'isc', '3306');
if (!$conn) {
die('Could not connect to MySQL: ' . mysqli_connect_error());
}
mysqli_query($conn, 'SET NAMES \'UTF-8\'');
$result = mysqli_query("delete from bookingrecord where bid='$bid' && roll_id='$roll_id'");
if ($result){
echo "sucess";
}
else echo "eorror. ";
运行后就出现:
Warning: mysqli_query() expects at least 2 parameters, 1 given in C:\Program Files\Apache Software Foundation\Apache2.2\htdocs\ISC_PHP\CP3110_Library\CP3110_Manlibrary_do.php on line 15
eorror. 展开
$roll_id = $_GET['roll_id'];
$conn = mysqli_connect('localhost', 'root', 'root', 'isc', '3306');
if (!$conn) {
die('Could not connect to MySQL: ' . mysqli_connect_error());
}
mysqli_query($conn, 'SET NAMES \'UTF-8\'');
$result = mysqli_query("delete from bookingrecord where bid='$bid' && roll_id='$roll_id'");
if ($result){
echo "sucess";
}
else echo "eorror. ";
运行后就出现:
Warning: mysqli_query() expects at least 2 parameters, 1 given in C:\Program Files\Apache Software Foundation\Apache2.2\htdocs\ISC_PHP\CP3110_Library\CP3110_Manlibrary_do.php on line 15
eorror. 展开
2个回答
展开全部
参数写错了。具体可以参考一下mysqli_query的调用方法。
mixed mysqli_query ( mysqli $link , string $query [, int $resultmode ] )
$result = mysqli_query("delete from bookingrecord where bid='$bid' && roll_id='$roll_id'");
这句参数出错了。
直接用 mysql_query不就很好用?
mysql_query($sql);
mixed mysqli_query ( mysqli $link , string $query [, int $resultmode ] )
$result = mysqli_query("delete from bookingrecord where bid='$bid' && roll_id='$roll_id'");
这句参数出错了。
直接用 mysql_query不就很好用?
mysql_query($sql);
AiPPT
2024-09-19 广告
2024-09-19 广告
随着AI技术的飞速发展,如今市面上涌现了许多实用易操作的AI生成工具1、简介:AiPPT: 这款AI工具智能理解用户输入的主题,提供“AI智能生成”和“导入本地大纲”的选项,生成的PPT内容丰富多样,可自由编辑和添加元素,图表类型包括柱状图...
点击进入详情页
本回答由AiPPT提供
展开全部
$bid = $_GET['bid'];
$roll_id = $_GET['roll_id'];
$conn = mysqli_connect('localhost', 'root', 'password');
if (!$conn) {
die('Could not connect to MySQL: ' . mysqli_connect_error());
}
else{
mysqli_query($conn, 'SET NAMES \'UTF-8\'');
$result = mysqli_query("delete from bookingrecord where bid='$bid' && roll_id='$roll_id'");
}
if ($result){
echo "sucess";
}
else echo "eorror. ";
$roll_id = $_GET['roll_id'];
$conn = mysqli_connect('localhost', 'root', 'password');
if (!$conn) {
die('Could not connect to MySQL: ' . mysqli_connect_error());
}
else{
mysqli_query($conn, 'SET NAMES \'UTF-8\'');
$result = mysqli_query("delete from bookingrecord where bid='$bid' && roll_id='$roll_id'");
}
if ($result){
echo "sucess";
}
else echo "eorror. ";
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询