[eluser]Unknown[/eluser]
I must start off by saying I\'m usually the type to just get really stubborn and figure it out on my own but this time I must admit I really need some help
Okay so lets get into it. I decided to use CI to code my website because I wanted to create a lean, very simple content managing system. Right now I\'m trying to pull text out of a database and display it on a page. I keep getting PHP Parse errors however, having messed around with it and getting different error messages
Here\'s what I have now:
Parse error: syntax error, unexpected T_STATIC, expecting T_STRING in [...]/system/application/models/static.php on line 2
Here\'s the code for my Model (it exists in the models folder as static.php):
Code:
<?php
class Static extends Model {
var $content = \'\';
function Static()
{
parent::Model();
}
function show_about_block()
{
$sql = \"SELECT content FROM static LIMIT 1\";
$this->db->query($sql);
return $this;
}
}
?>
I\'m guessing you\'ll need the
controller and the View too so here goes:
Controller (exists in controllers folder as
home.php):
Code:
<?php
class Home extends Controller {
function Home()
{
parent::Controller();
}
function index()
{
$this->load->model(\'static\');
$data[\'about\'] =
$this->static->show_about_block();
$this->load->view(\'home_page\', $data);
}
}
?>
And Finally View (exists in views folder as
home_page.php):
Code:
<html>
<head>
<title>DeadRinger</title>
<!--
(REMOVED CSS TO SAVE SPACE IN THIS POST) ->
</head>
<body>
<h1>DeadRinger Media -
COMING SOON</h1>
<p>Test:</p>
<p><?php echo $about
?></p>
</body>
</html>
Let me know if you\'ll want information about my
Database too! Thanks so much in advance! I\'ll see if perhaps I can return the favor somehow.
Thanks
again,
Sean"