load->helper("form"); //$sql = "select * from userinf"/> load->helper("form"); //$sql = "select * from userinf">

Home  >  Article  >  Backend Development  >  PHP MVC菜鸟有关问题.

PHP MVC菜鸟有关问题.

WBOY
WBOYOriginal
2016-06-13 12:40:35883browse

PHP MVC初学者问题...

<br />
		function postedit(){<br />
			$this->load->helper("url");<br />
			$this->load->helper("form");<br />
			//$sql = "select * from userinfo where username = 'zhangning'";<br />
			$data["user"] = $this->db->query("select * from userinfo where username = '".$this->uri->segment(3)."'");<br />
			<br />
			$this->load->view("postedit",$data);<br />
		}<br />

前台:
<?php echo $user->Age ?>




A PHP Error was encountered

Severity: Notice

Message: Undefined property: CI_DB_mysql_result::$Age

Filename: views/postedit.php

Line Number: 9

啥原因呀?找了半天了。。。刚学2 3天。。看不出来哪有错。
$data["user"] ="fsdfsd";如果这样前台会输出值得

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn