English Deutsch Français Italiano Español Português 繁體中文 Bahasa Indonesia Tiếng Việt ภาษาไทย
All categories

i have the following code in PHP:

case 'modifica':
$cerere_sql='UPDATE `pages` SET continut="'.$_POST['scris'].'" WHERE sectiune="'.$_POST['page'].'"';
//$cerere_sql='INSERT INTO `pages` (`Contact`) VALUES ("'.$_POST['scris'].'")';
mysql_query($cerere_sql);
echo '

Pagina a fost modificata cu Succes!
';
break;

everithing works greate, except that wen I try to write " this won't get modified in my database. (when scris...from $_POST['scris'] has " in the text)why? and how can I write that?

2006-08-30 12:19:47 · 2 answers · asked by Pazvanti 2 in Computers & Internet Programming & Design

2 answers

Have you tried using regexp in PHP to escape the " with a \ before the variable makes it's way into your query?

2006-08-30 12:27:19 · answer #1 · answered by knieveltech 3 · 0 1

Well, just take the " out!!

2006-08-30 12:26:25 · answer #2 · answered by ♥Em[ily]♥ 2 · 0 1

fedest.com, questions and answers