fabiez Posted January 17, 2015 Share Posted January 17, 2015 I Can't find the problem. The code: mysql_query("insert into games(week, fight, league_id)values($_REQUEST['week'],'$_REQUEST[home_team]-$_REQUEST[guest_team]',$_REQUEST['home_league'])", $Link); The error message: Parse error: syntax error, unexpected T_ENCAPSED_AND_WHITESPACE, expecting T_STRING or T_VARIABLE or T_NUM_STRING Link to comment https://forums.phpfreaks.com/topic/294004-parse-error-syntax-error-unexpected-t_encapsed_and_whitespace-expecting-t_string-or-t_variable-or-t_num_string/ Share on other sites More sharing options...
fabiez Posted January 17, 2015 Author Share Posted January 17, 2015 problem solved. Link to comment https://forums.phpfreaks.com/topic/294004-parse-error-syntax-error-unexpected-t_encapsed_and_whitespace-expecting-t_string-or-t_variable-or-t_num_string/#findComment-1503235 Share on other sites More sharing options...
Ch0cu3r Posted January 17, 2015 Share Posted January 17, 2015 You should be sanitizing your data before using it in your query. Also the mysql_* functions are deprecated. You should be using PDO or MySQLi. Link to comment https://forums.phpfreaks.com/topic/294004-parse-error-syntax-error-unexpected-t_encapsed_and_whitespace-expecting-t_string-or-t_variable-or-t_num_string/#findComment-1503238 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.