heckler0077 Posted May 20, 2009 Share Posted May 20, 2009 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. Quote Link to comment https://forums.phpfreaks.com/topic/158853-mysql_query-causing-unexpected-t_encapsed_and_whitespace/ Share on other sites More sharing options...
Masna Posted May 20, 2009 Share Posted May 20, 2009 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']."')"); Quote Link to comment https://forums.phpfreaks.com/topic/158853-mysql_query-causing-unexpected-t_encapsed_and_whitespace/#findComment-837843 Share on other sites More sharing options...
BobcatM Posted May 20, 2009 Share Posted May 20, 2009 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]')"); Quote Link to comment https://forums.phpfreaks.com/topic/158853-mysql_query-causing-unexpected-t_encapsed_and_whitespace/#findComment-837848 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.