php - SQL error due to ' in variable contents -
this question has answer here:
- how can prevent sql injection in php? 28 answers
good morning,
i have issue sql insert command php. i'm trying following code:
$teammatchtable = "insert team match table (lineupforward) values ('$homelineupforward')";`
however contents of $homelineupforward
variable is: alexandre d'acol;
this resulting in error because of '
.
what can solve problem?
you can try this.
$homelineupforward= mysql_real_escape_string($homelineupforward); $teammatchtable = "insert team match table ('lineupforward') values ('$homelineupforward')";
Comments
Post a Comment