php - SQL error due to ' in variable contents -


this question has answer here:

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

Popular posts from this blog

authentication - Mongodb revoke acccess to connect test database -

r - Update two sets of radiobuttons reactively - shiny -

ios - Realm over CoreData should I use NSFetchedResultController or a Dictionary? -