我的计划有困难。错误说:
遇到PHP错误
严重性:注意
消息:未定义属性:CI_DB_mysqli_result :: $ level
文件名:controllers / Auth.php
行号:30
回溯:
文件: C:\ XAMPP \ htdocs中\ PKLTelkom \ Telkom2 \应用\控制器\ Auth.php 行:30功能:_error_handler
文件:C:\ xampp \ htdocs \ PKLTelkom \ Telkom2 \ index.php行:315功能: require_once
这是我的控制器名为“Auth”:
<?php
class M_login extends CI_Model
{
function data_login($username, $password)
{
$this->db->where('username', $username);
$this->db->where('password', $password);
return $this->db->get('akun');
}
}
?>
这是我的模型名为“M_Login”:
//if iPhone
if (UI_USER_INTERFACE_IDIOM() == UIUserInterfaceIdiomPhone) {
[self presentViewController:actionSheet animated:YES completion:nil];
}
//if iPad
else {
// Change Rect to position Popover
UIPopoverController *popup = [[UIPopoverController alloc] initWithContentViewController:actionSheet];
[popup presentPopoverFromRect:CGRectMake(self.view.frame.size.width/2, self.view.frame.size.height/4, 0, 0)inView:self.view permittedArrowDirections:UIPopoverArrowDirectionAny animated:YES];
}
答案 0 :(得分:1)
看起来像return $this->db->get('akun');
on&#34; M_login&#34; model不返回名为level
的对象。
尝试在&#34; M_Login&#34;上更改此行型号:
<?php
class M_login extends CI_Model
{
function data_login($username, $password)
{
$this->db->where('username', $username);
$this->db->where('password', $password);
return $this->db->get('akun')->row(); // change this line
}
}
?>