Jessica Posted March 9, 2007 Share Posted March 9, 2007 function send(){ $time = time(); $sql = "INSERT INTO mail(from, userTo, subject, message, sent) VALUES($this->from, $this->$to, '$this->subject', '$this->message', $time)"; return dbExecute($sql); } Parse error: syntax error, unexpected T_VARIABLE, expecting T_STRING on line 57 57 is the $sql = line. What am I missing? Quote Link to comment https://forums.phpfreaks.com/topic/42023-parse-error/ Share on other sites More sharing options...
per1os Posted March 9, 2007 Share Posted March 9, 2007 <?php function send(){ $time = time(); $sql = "INSERT INTO mail(from, userTo, subject, message, sent) VALUES($this->from, $this->to, '$this->subject', '$this->message', $time)"; return dbExecute($sql); } ?> Try that maybe that should work. Replace $this->$to with $this->to --FrosT Quote Link to comment https://forums.phpfreaks.com/topic/42023-parse-error/#findComment-203773 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.