This is a discussion on try to insert data... within the PHP Language forums, part of the PHP Programming Forums category; hi, i try to insert data in a database Code: $mem_nomembre = $_SESSION["mem_nomembre"]; $sec_nosection = $_POST['sec_nosection']; $str = $_POST[&...
|
|||||||
| FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
|
|||
|
hi,
i try to insert data in a database Code:
$mem_nomembre = $_SESSION["mem_nomembre"];
$sec_nosection = $_POST['sec_nosection'];
$str = $_POST["message"];
$str = preg_replace_callback('`\[(code|url|img)\](.+?)\[/\1\]`si',
'bbcode', $str);
$str = mysql_real_escape_string($str);
mysql_query("insert into message (sec_nosection, mem_nomembre,
mes_titre, mes_message) values ('".$_POST['sec_nosection']."',
'".$mem_nomembre."', '".$_POST["titre"]."', '".$str."')");
if i try to insert: j'ai l'impression en parcourant le web when i display the message i get: j\'ai l\'impression en parcourant le web if i put: stripslashes after mysql_real_escape_string, there are some: rn in the sentence... how to correct that? when i insert a message, if i write today is hot. i like swimming. i would like to get the same result... now that display me: today is hot. i like swimming. if i do: $str = preg_replace_callback('`\[(code|url|img)\](.+?)\[/\1\]`si', 'bbcode', $str); $str = nl2br($str); $str = mysql_real_escape_string($str); i get: today is hot. i like swimming. how to get this result? thanks |