【发布时间】:2016-06-26 15:54:41
【问题描述】:
我想先检查一下 mycode_sn 是否存在于数据库中。 如果 mycode_sn 不存在,什么也不做。
这是函数:
function input_me_by_mycode($input_type, $input_id, $total_number)
{
if ($input_type == 'mycode') {
$my_info = $this->db->get_where('mytable', array(
'mycode_sn' => $input_id
))->row();
}
echo '<tr id="entry_row_' . $total_number . '">;
}
我尝试了多种方法,但显然我不太了解。
现在在不存在的情况下,我会收到消息:
遇到 PHP 错误 严重性:通知消息:正在尝试获取 非对象的属性
【问题讨论】:
标签: php mysql codeigniter activerecord mysqli