CodeIgniter Forums
controllers/News.php - Printable Version

+- CodeIgniter Forums (https://forum.codeigniter.com)
+-- Forum: Using CodeIgniter (https://forum.codeigniter.com/forumdisplay.php?fid=5)
+--- Forum: Model-View-Controller (https://forum.codeigniter.com/forumdisplay.php?fid=10)
+--- Thread: controllers/News.php (/showthread.php?tid=73484)

Pages: 1 2


controllers/News.php - shewolf255 - 04-29-2019

I am busy to teach myself Codeigniter and to lean it form the Codeigniter website.

And I keep on getting this error code when trying to test run the news.php page.

 An uncaught Exception was encountered
Type: ParseError
Message: syntax error, unexpected '$this' (T_VARIABLE)
Filename: C:\wamp64\www\aircomp.co.za\application\controllers\News.php
Line Number: 9
Backtrace:
File: C:\wamp64\www\aircomp.co.za\index.php
Line: 315


Please could somebody help me.

Angry


RE: controllers/News.php - ciadmin - 04-29-2019

The error message says there is a syntax error on line 9 of your News controller.
Share the code for that and we can point you in the right direction.


RE: controllers/News.php - shewolf255 - 04-29-2019

Hi there.

here is the screen hot of my code.


RE: controllers/News.php - ciadmin - 04-29-2019

You have misspelled "database" as "databse" in line 8.


RE: controllers/News.php - shewolf255 - 04-29-2019

Thanks for coming back to me asap. Now it say's there is a error on line 9 which is empty.

Please see attached screen shots.


RE: controllers/News.php - albertleao - 04-29-2019

You have a typo on line 18 with result


RE: controllers/News.php - shewolf255 - 04-29-2019

So I can delete } online in controllers/News.php. Is this correct ?


RE: controllers/News.php - shewolf255 - 04-29-2019

(04-29-2019, 07:13 AM)albertleao Wrote: You have a typo on line 18 with result

I am still getting errors as I have followed all the instructions from the Manuel.


RE: controllers/News.php - Wouter60 - 04-29-2019

And also a typo on line 13: $sluig


RE: controllers/News.php - ciadmin - 04-29-2019

You deleted the vurly brace at the end of the index method, before line 18.
You need to proof-read your code before jumping to the conclusion that CI is broken.