Jump to content

mysql_query causing unexpected T_ENCAPSED_AND_WHITESPACE


heckler0077

Recommended Posts

When running this code:

 

mysql_query("INSERT INTO crashReport (application, appVersion, osVersion, comments, time, date, mailaddress, rapport) VALUES ($_POST['application'], $_POST['appVersion'], $_POST['osVersion'], $_POST['comments'], $_POST['time'], $_POST['date'], $_POST['mailaddress'], $_POST['rapport'])");

 

I get this error:

 

PHP Parse error:  syntax error, unexpected T_ENCAPSED_AND_WHITESPACE, expecting T_STRING or T_VARIABLE or T_NUM_STRING

 

I'm not quite clear what I should do to rectify this error.

mysql_query("INSERT INTO crashReport (application, appVersion, osVersion, comments, time, date, mailaddress, rapport) VALUES ('".$_POST['application']."', '".$_POST['appVersion']."', '".$_POST['osVersion']."', '".$_POST['comments']."', '".$_POST['time']."', '".$_POST['date']."', '".$_POST['mailaddress']."', '".$_POST['rapport']."')");

Try this..

 

Also post the rest of your code please.

 


mysql_query("INSERT INTO crashReport (application, appVersion, osVersion, comments, time, date, mailaddress, rapport) VALUES ('$_POST[application]', '$_POST[appVersion]', '$_POST[osVersion]', '$_POST[comments]', '$_POST[time]', '$_POST[date]', '$_POST[mailaddress]', '$_POST[rapport]')");

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.