Jump to content

Unexpected T_STRING - line 324


mb326

Recommended Posts

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

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?

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.