mb326 Posted April 1, 2008 Share Posted April 1, 2008 I don't understand why I'm getting this error - I've used the double brackets format in a previous SQL statement ... public function sendEmail($userID1, $userID2, $subject, $body) { // assignments $this->userID1 = $userID1; $this->userID2 = $userID2; $this->subject = $subject; $this->body = $body; // show the current time and day in the email $now = date('D M Y h:m:s'); $swapMsg = mysqli_query($this->db, "INSERT INTO Email (userID, recipient, subject, emailBody, emailTime) VALUES ('$userID1', '$userID2', '$subject', '$body', '$now')"); // Confirm that message has been sent and print out details if(!$swapMsg) { echo "Your message has been sent to RT $swapUser\n"; echo "Message Details\n:"; echo "From: $userID1\n"; echo "To: $userID2\n"; echo $body"\n"; } else { echo "Message failed to deliver, please try again later\n"; } } Link to comment https://forums.phpfreaks.com/topic/99054-unexpected-t_string-line-324/ Share on other sites More sharing options...
mb326 Posted April 1, 2008 Author Share Posted April 1, 2008 The error falls in this line: $swapMsg = mysqli_query($this->db, "INSERT INTO Email (userID, recipient, subject, emailBody, emailTime) VALUES ('$userID1', '$userID2', '$subject', '$body', '$now')"); Link to comment https://forums.phpfreaks.com/topic/99054-unexpected-t_string-line-324/#findComment-506866 Share on other sites More sharing options...
trq Posted April 1, 2008 Share Posted April 1, 2008 I don't see any syntax errors in that code. Link to comment https://forums.phpfreaks.com/topic/99054-unexpected-t_string-line-324/#findComment-506870 Share on other sites More sharing options...
mb326 Posted April 1, 2008 Author Share Posted April 1, 2008 Well, that's what the message is throwing me. I'm running my scripts on the latest version - PHP 5.2.5 as well. I initially thought that the problem lay in the date() class, but then tried that line out and echoed it within a .php script and it worked fine. So at the moment, I'm as puzzled as you thorpe. Can anyone else help? Link to comment https://forums.phpfreaks.com/topic/99054-unexpected-t_string-line-324/#findComment-506901 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.