I get an error below when my code is parsed Please, please help me solve it The default controller page is also not provided. (!) Parse error: Syntax error, Expected '(', T_STRING or T_VARIABLE or '' '' '' '' 'Www' Test 'application in' C: \ wamp ' \ Model \ site_mod.php o 'code here `one line 18 call stack # time memory function location 1 0.0004 385288 {main} () .. \ index.php: 0 2 0.0012 458288 require_once (' C: \ wamp \ www \ Test \ system \ core \ CodeIgniter.php ') .. \ index.php: 202 3 0.0137 1362696 Site-> __Construct () .. \ CodeIgniter.php: 308 4 0.0137 1362696 CI_Controller-> __Construct ( ) .. \ site.php: 7 5 0.0155 1626240 CI_Loader-> Start () .. \ controller.php: 51 6 0.0156 1627392 CI_Loader-> _ci_autoloader () .. \ Loader.php: 152 7 0.0261 2834120 CI_Loader-> Model () .. \ Loader.php: 1185 8 0.0261 2834368 CI_Loader-> Model () .. \ Loader.php: 237
site. Php - this is my admin -
& lt ?? php if (! Define ('BASEPATH')) exit ('no direct script entry is allowed'); cl ass site CI_Controller Expands {Public Function __construct () {Origin: __ Construction (); } Public Function Index () {$ this- & gt; Load-> View ('option_view'); } Create the function () {$ this-> Site_mode-> Plus_record ($ data); $ This- & gt; Index (); }}
option_view.php - this is my view ---
& Lt ;? Php echo form_open ('Site / Create'); ? & Gt; & Lt; P & gt; & Lt; = "Title" & gt; Title & lt; / Labels & gt;: & lt; Input type = "text" name = "title" id = "" value = "" /> gt; & Lt; / P & gt; & Lt; P & gt; & Lt; For lable = "content" & gt; Content & lt; / Lable & gt;: & lt; Input type = "text" name = "content" id = "" value = "" /> gt; & Lt; / P & gt; & Lt; P & gt; & Lt; Input type = "submit" value = "create" /> & Lt; / P & gt; & Lt ;? Php echo form_close (); ? & Gt; & Lt; / Div & gt; & Lt; / Body & gt; & Lt; / Html & gt;
site_mod.php - this is my model ---
& lt ;? Php class extends Site_mod CI_Model {function __construct () {// call model manufacturer origin: __ creation (); } Get_records function () {$ query = $ this- & gt; Db- & gt; Receive ('test'); Return $ query- & gt; result (); } Function add_record ($ data) {$ this- & gt; Db- & gt; Insert-> ('Test', $ data); Return; } Function update_record ($ data) {$ this- & gt; Db- & gt; Where ('id', 14); $ This- & gt; Db- & gt; Update ('test', $ data); } Function delete_row () {$ this-> Db- & gt; Where ('id', $ this-> uri- & gt; Segment (3)); $ This- & gt; Db- & gt; Delete ('test'); }}
I count 18 lines in site_mod.php and there
$ this-> DB- & gt; Include-> ('test', $ data);
An additional -> is followed by 'insert'.
No comments:
Post a Comment