php5.5 mysqli_query不能在function里执行
代码如下:<?phpinclude("conn.php");//链接数据库functionpayedit($fpno,$pno,$puno){$sqlpayedit=my...
代码如下:
<?php
include("conn.php");//链接数据库
function payedit($fpno,$pno,$puno){
$sqlpayedit=mysqli_query($link,"select * from pay where fpno='$fpno',pno='$pno',puno='$puno'");
$sqlpayeditwaw=mysqli_query($sqlpayedit);
return $sqlpayeditwaw;
}
?>
这里是函数代码
下面要执行
<?php
$edit=payeit()
echo $edit[2];
?>
报错:
Warning: Missing argument 1 for payedit(), called in D:\wamp\www\payedit.php on line 74 and defined in D:\wamp\www\function.php on line 3
Call Stack
Notice: Undefined variable: link in D:\wamp\www\function.php on line 5
<?php
$edit=payeit(11122,2221,55555)
echo $edit[2];
?> 展开
<?php
include("conn.php");//链接数据库
function payedit($fpno,$pno,$puno){
$sqlpayedit=mysqli_query($link,"select * from pay where fpno='$fpno',pno='$pno',puno='$puno'");
$sqlpayeditwaw=mysqli_query($sqlpayedit);
return $sqlpayeditwaw;
}
?>
这里是函数代码
下面要执行
<?php
$edit=payeit()
echo $edit[2];
?>
报错:
Warning: Missing argument 1 for payedit(), called in D:\wamp\www\payedit.php on line 74 and defined in D:\wamp\www\function.php on line 3
Call Stack
Notice: Undefined variable: link in D:\wamp\www\function.php on line 5
<?php
$edit=payeit(11122,2221,55555)
echo $edit[2];
?> 展开
1个回答
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询