Friday, 15 April 2011

comma - Inserting string with simple apostrophe in mysql -



comma - Inserting string with simple apostrophe in mysql -

this question has reply here:

how can prevent sql-injection in php? 28 answers apostrophe during insert (mysql) 3 answers

im trying set info in info base, info text file, have next problem, there words want insert have simple apostrophe (') how know when u create insert string need couple of '' each string, when word simple apostrophe comes in got error of syntax. example:

where $player = n'zogbia

$resultado = mysql_query( "insert equipo values( '$nom_equipo', '$player' );" , $link );

how insert kind of name without modify simple apostrophe?

i utilize function addslashes or real_escape_string: http://php.net/manual/en/function.addslashes.php http://www.php.net/manual/en/mysqli.real-escape-string.php

mysql comma

No comments:

Post a Comment