Welcome Guest, Not a member yet? Register   Sign In
help me please. Im a beginner
#1

[eluser]tunabelly14[/eluser]
Im new in CI so I follow the tutorial in this link. http://net.tutsplus.com/tutorials/php/co...er-basics/ . After I finished following the tutorial I got this error. "Parse error: syntax error, unexpected '<', expecting T_STRING or T_VARIABLE or '{' or '$' in /Applications/MAMP/htdocs/application/controllers/helloworld.php on line 7". I don't know how to debug this because CI is quite different in plain php. I hope you can help me solve this Thank you in advance.

//this is my code in helloworld.php
&lt;?php
class Helloworld extends Controller{
function index()
{
$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);
}
}
?&gt;


//this is my code in helloworld_view.php
&lt;html&gt;
&lt;head&gt;
&lt;title&gt;&lt;?=$page_title?&gt;&lt;/title&gt;
&lt;/head&gt;
&lt;body&gt;
&lt;?php foreach($result as $row):?&gt;
<h3>&lt;?=$row->title?&gt;</h3>
<p>&lt;?=$row->text?&gt;</p>
<br />
&lt;?php endforeach;?&gt;
&lt;/body&gt;
&lt;/html&gt;

//this my code in helloworld_model.php
&lt;?php
class Helloworld_model extends Model {

function Helloworld_model()
{
// Call the Model constructor
parent::Model();
}

function getData()
{
//Query the data table for every record and row
$query = $this->db->get('data');

if ($query->num_rows() > 0)
{
//show_error('Database is empty!');
}else{
return $query->result();
}
}

}
?&gt;


Messages In This Thread
help me please. Im a beginner - by El Forum - 06-06-2011, 12:17 AM
help me please. Im a beginner - by El Forum - 06-06-2011, 12:51 AM
help me please. Im a beginner - by El Forum - 06-17-2011, 04:27 AM
help me please. Im a beginner - by El Forum - 06-18-2011, 08:10 AM



Theme © iAndrew 2016 - Forum software by © MyBB