Parse Error Syntax Error Unexpected T_object_operator Codeigniter
Contents |
here for a quick overview of the site Help Center Detailed answers to any questions you might have t_object_operator php Meta Discuss the workings and policies of this site About Us
Syntax Error Unexpected T_object_operator In Php
Learn more about Stack Overflow the company Business Learn more about hiring developers or posting ads with
Syntax Error Unexpected T_object_operator In Cakephp
us Stack Overflow Questions Jobs Documentation Tags Users Badges Ask Question x Dismiss Join the Stack Overflow Community Stack Overflow is a community of 6.2 million programmers, just
Parse Error Syntax Error Unexpected T_object_operator Yii
like you, helping each other. Join them; it only takes a minute: Sign up Parse error php Codeigniter up vote 1 down vote favorite I have this function on my code, and give me this error: syntax error, unexpected '->' (T_OBJECT_OPERATOR), expecting ')' on line 25 I cant find the error maybe you can see what I syntax error, unexpected '->' (t_object_operator) laravel can't D: public function InsertHero() { $this->load->view('Header'); $this->load->view('HeroForm'); $this->load->view('Footer'); $data = array( 'Name' -> $this -> input -> post('nick'), //this is the line 25 'Power' -> $this -> input -> post('superpower'), 'Phone' -> $this -> input -> post('phone'), 'Email' -> $this -> input -> post('mail'), 'Category' -> $this -> input -> post('category_id') ); $this->model_heroes->insert($data); redirect(base_url()); } php codeigniter php-parse-error share|improve this question asked Sep 3 '15 at 14:56 Ali ATriple 9911 2 hash array syntax is $data = array('Name' => $this->input->post('nick')); –Rooneyl Sep 3 '15 at 14:58 And here is your source to learn how to make arrays in php. php.net/manual/en/… –Tim Dev Sep 3 '15 at 15:00 -_-'' thank you I forgot that ... –Ali ATriple Sep 3 '15 at 15:02 add a comment| 2 Answers 2 active oldest votes up vote 1 down vote accepted Simple error, you have used the operator for classes/objects (T_OBJECT_OPERATOR is ->) in your array declaration, when you should have used the T_DOUBLE_ARROW => oper
here for a quick overview of the site Help Center Detailed answers to any questions you might have Meta Discuss the workings and policies of this site About Us Learn more about Stack Overflow the company Business Learn more about hiring developers or posting ads with us Stack Overflow Questions Jobs Documentation Tags Users Badges Ask Question x Dismiss Join the Stack Overflow Community Stack Overflow is a community of 6.2 million programmers, just like you, helping each other. Join them; it only takes a minute: Sign up syntax error, unexpected '->' (T_OBJECT_OPERATOR) http://stackoverflow.com/questions/32379084/parse-error-php-codeigniter in Code Igniter [closed] up vote 0 down vote favorite Hi I'm new To Code Ignitor And i want to know why my code produced this error. function index(){ $this->load->library('form-validation'); $this->form-validation-set_rules('username','Username','trim|required'); $this->form-validation-set_rules('password','Password','trim|required'); if ($this->form-validation->run() == FALSE) { $this->load->view('reg_form_view');//failed input } else { //redirect('reg_success','refresh'); echo "success"; } } php codeigniter validation share|improve this question edited Apr 1 at 11:22 Muhammad Arif 64511241 asked Apr 1 at 10:54 http://stackoverflow.com/questions/36354490/syntax-error-unexpected-t-object-operator-in-code-igniter/36354627 CodeNoob 61 closed as off-topic by RiggsFolly, Abdulla Nilam, Vadim Martynov, Ferrybig, hichris123 Apr 5 at 15:32 This question appears to be off-topic. The users who voted to close gave these specific reasons:"This question was caused by a problem that can no longer be reproduced or a simple typographical error. While similar questions may be on-topic here, this one was resolved in a manner unlikely to help future readers. This can often be avoided by identifying and closely inspecting the shortest program necessary to reproduce the problem before posting." – RiggsFolly, Ferrybig, hichris123"Questions seeking debugging help ("why isn't this code working?") must include the desired behavior, a specific problem or error and the shortest code necessary to reproduce it in the question itself. Questions without a clear problem statement are not useful to other readers. See: How to create a Minimal, Complete, and Verifiable example." – Abdulla Nilam, Vadim MartynovIf this question can be reworded to fit the rules in the help center, please edit the question. issue is in form-validation- change it to form_validation-> in case it not works check what object is created by the library file i.e. from form-validation –Cheta
error: syntax error, unexpected T_OBJECT_OPERATOR $this-db->update Thread Closed 0 Vote(s) - 0 Average 1 2 3 4 5 Thread Modes Parse error: syntax error, unexpected T_OBJECT_OPERATOR http://forum.codeigniter.com/thread-51463.html $this-db->update El Forum Unregistered #1 05-04-2012, 04:40 PM [eluser]darian311[/eluser] Attempted call: https://www.joomlart.com/forums/topic/new-problem-parse-error-syntax-error-unexpected-t_object_operator/ example.com/CodeIgniter/index.php/dbexample/update_user?fb_id=1001&cash=33&coins=22&villagestate=crack Got ERROR MESSAGE: Quote:Parse error: syntax error, unexpected T_OBJECT_OPERATOR in /home/darhic/labs.villagethegame.com/CodeIgniter/application/controllers/dbexample.php on line 36 Offending line: Code: $this-db->update('villagegame', $_GET); All the other functions on this controller work fine. Any ideas what's wrong with line above? -Darian SOURCE: Code:
class Dbexample extends CI_Controller{
public function dbexample(){
parent::__construct();
echo("Get's type:" . gettype($_GET));
}
public function index(){
$this->load->database();
$query = $this->db->query('SELECT fb_id, cash, coins FROM villagegame');
foreach ($query->result() as $row)
{
echo $row->fb_id;
syntax error unexpected echo $row->coins;
echo $row->cash;
}
echo 'Total Results: ' . $query->num_rows();
}
public function add_user(){
$this->db->insert('villagegame', $_GET);
}
public function delete_user(){
$this->db->delete('villagegame', $_GET);
}
public function update_user(){
$this->db->where('fb_id', $_GET['fb_id']);
unset($_GET['fb_id']);
$this-db->update('villagegame', $_GET);
}
}
?> El Forum Unregistered #2 05-04-2012, 04:45 PM [eluser]CroNiX[/eluser] Look closely at your offending line again. But besides that, what you are doing is crazy with no validation at all. El Forum Unregistered #3 05-04-2012, 04:49 PM [eluser]darian311[/eluser] Thanks for the quick response. didn't see missing > until just now. I'll be researching libs for input validation later. Got recommendations? El Forum Unregistered #4 05-05-2012, 04:31 AM [eluser]InsiteFX[/eluser] CodeIgniter Users Guide - Input Class CodeIgniter Users Guide - Form Validation CodeIgniter Users Guide - Form Helper Thread Closed -------------------- Private Messages User Control Panel Wh
& Tutorials Updates 30% OFF for JA Admin Template with free JA User module & JA Google Analytics Reports Module - Coupon: JADMIN30 Buy Now! DesignWall UberTheme ThemeBrain DesignBold Templates Extensions Support Forums Documentation Video Tutorials Joomla Glossary Support Policy Custom Services Download Blog Demo Member Pricing NEW PROBLEM - Parse error: syntax error, unexpected T_OBJECT_OPERATOR ForumsPublic ForumsGeneral QuestionsNEW PROBLEM - Parse error: syntax error, unexpected T_OBJECT_OPERATOR Viewing 14 posts - 1 through 14 (of 14 total) Author Posts lawman Friend lawmanJoin date: November 2010Posts: 9Downloads:0Uploads:0 Thanks: 2 October 10, 2011 at 6:00 am #169512 I love Joomla…. Thanks for the support. MY WEBSITE IS http://www.trueminecraft.com/ SEEMS TO BE A NEW PROBLEM. Please help if you can, I don't know much about Joomla but have learned many new things over the past year. I have a problem with the page not loading sometimes and giving me this random error. Parse error: syntax error, unexpected ‘:' in /home/lawman/public_html/libraries/joomla/utilities/simplexml.php(305) : eval()'d code on line 1 Parse error: syntax error, unexpected T_OBJECT_OPERATOR, expecting T_STRING or T_VARIABLE or ‘{‘ or ‘$' in /home/lawman/public_html/libraries/joomla/utilities/simplexml.php(335) : eval()'d code on line 1 Parse error: syntax error, unexpected ‘:' in /home/lawman/public_html/libraries/joomla/utilities/simplexml.php(305) : eval()'d code on line 1 Parse error: syntax error, unexpected T_OBJECT_OPERATOR, expecting T_STRING or T_VARIABLE or ‘{‘ or ‘$' in /home/lawman/public_html/libraries/joomla/utilities/simplexml.php(335) : eval()'d code on line 1 Parse error: syntax error, unexpected T_OBJECT_OPERATOR, expecting T_STRING or T_VARIABLE or ‘{‘ or ‘$' in /home/lawman/public_html/libraries/joomla/utilities/simplexml.php(335) : eval()'d code on line 1 Parse error: syntax error, unexpected T_OBJECT_OPERATOR, expecting T_STRING or T_VARIABLE or ‘{‘