开发者

Unexplained parse error in my script [closed]

It's difficult to tell what is being asked here. This question is ambiguous, vague, incomplete, overly broad, or rhetorical and cannot be reasonably answered in its current form. For help clarifying this question so that it can be reopened, visit the help center. 开发者_如何转开发 Closed 11 years ago.

Parse error: syntax error, unexpected '<', expecting T_STRING or T_VARIABLE or '{' or '$'

I am getting the above error in Code Igniter coding, mainly in line 2:

$this->load->model('helloworld_model');
$data['result'] = $this->helloworld_model-><span class="sql"> getData </span>();
$data['page_title'] = "CI Hello World App!";
$this->load->view('helloworld_view',$data);

Please help me to fix this.


Instead of

$data['result'] = $this->helloworld_model-><span class="sql"> getData </span>();
                                           ^

try

$data['result'] = $this->helloworld_model->getData();

Looks like some HTML made it into your PHP, probably while you copied and pasted it.

I assume you put the ** in there to mark the line this is about. If not, remove them as well.


$this->helloworld_model-><span class="sql"> getData </span>();

This is clearly wrong. Something has mangled your code, possibly something in your IDE.

Write:

$this->helloworld_model->getData();

BTW I see you've tried to use Markdown bold inside a code block; unfortunately you can't do that.


your PHP does not parse, the < is unexpected. i'm not completely sure what kind of framework you are using here, but inserting a span directly into the PHP code will not work..

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜