我是 php 新手,我正在尝试在 php 5 中工作,所以我调用了一个参数化函数,但它给了我异常“警告:缺少参数 1”这是我的课程
class EditUser extends DBConn
{
private $id;
function editUser($id)
{
$this->id = $id;
echo $id;
die;
$rows =array();
self::Set_DBConni();
$mysqli = self::get_Conn();
$result = $mysqli->query("SELECT * FROM users where id ='".$id."' ");
while($row = $result->fetch_row())
{
$rows[] = $row;
}
return $rows;
/* free result set */
$result->close();
/* close connection */
$mysqli->close();
}
}
这就是我所说的
include_once('include/classes/edituser.php');
$objPage = new EditUser();
$objPage->editUser($_GET['id']);
但它向我显示了警告,那就是
Warning: Missing argument 1 for EditUser::editUser(), called in E:\xampp\htdocs\WaleedWork\claremont\admin\edit_user.php on line 45 and defined in E:\xampp\htdocs\WaleedWork\claremont\admin\include\classes\edituser.php on line 8
Notice: Undefined variable: id in E:\xampp\htdocs\WaleedWork\claremont\admin\include\classes\edituser.php on line 10
Notice: Undefined variable: id in E:\xampp\htdocs\WaleedWork\claremont\admin\include\classes\edituser.php on line 11
请告诉我出了什么问题,因为我认为我正在使用正确的方式来调用它。