Closed za closed 11 years ago
Hello,
I am trying to follow the code igniter tutorial. It's the news section[1]. When I tried to run it, it failed.
The apache error log shows:
PHP Parse error: syntax error, unexpected '=' in /var/www/ci/application/models/news_model.php on line 18
Line 18 is:
query = $this->db->get_where('news', array('slug' => $slug));
What caused this problem? I am using codeigniter 2.1.4 and PHP 5.3.6
[1]http://ellislab.com/codeigniter/user-guide/tutorial/news_section.html
The error message indicates your problem very clearly, you missed the $ sign before the variable query.
$query = $this->db->get_where('news', array('slug' => $slug));
Hrrr.... my bad.
@tkaw220 thank you!
Hello,
I am trying to follow the code igniter tutorial. It's the news section[1]. When I tried to run it, it failed.
The apache error log shows:
Line 18 is:
What caused this problem? I am using codeigniter 2.1.4 and PHP 5.3.6
[1]http://ellislab.com/codeigniter/user-guide/tutorial/news_section.html