help me please. Im a beginner |
[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 <?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); } } ?> //this is my code in helloworld_view.php <html> <head> <title><?=$page_title?></title> </head> <body> <?php foreach($result as $row):?> <h3><?=$row->title?></h3> <p><?=$row->text?></p> <br /> <?php endforeach;?> </body> </html> //this my code in helloworld_model.php <?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(); } } } ?> |
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
|