私はslqテーブル(postgresdb)を作成しますが、フィールド 'notes'のすべての値を出力したいが、phpはこの値の最初の単語のみを出力します。 'イプサムディキシット'なぜphpがフィールドテキストタイプのすべての内容を出力しないのですか
なぜを切断
$name=trim($_POST['name']);
//select
if(!$query = @pg_query($conn,"SELECT notes FROM customer WHERE customer.name = '$name' "))
die("Errore nella query: " . pg_last_error($conn));
//print the content of field 'notes'
while($row = pg_fetch_array($query))
{
echo "<li>Notes: <input type=\"text\" placeholder=\"insert text\" id=\"note\" value=".$row['note']."></li>";
}
私のフィールドノートの値が 'Loremのイプサムのディキシット' である場合、PHPの印刷のみ 'Loremの'?私は解決策を見つける
は、私はあなたにみんなに感謝
<li>Note: <input type="text" placeholder="inserisci testo" id="note" value=" <?php echo $row['note'] ?>"></li>
で
echo "<li>Notes: <input type=\"text\" placeholder=\"insert text\" id=\"note\" value=".$row['note']."></li>";
を交換
DBレコードの内容である "lorem ipsum dixit" ? – azat
これは二重引用符を含む可能性があるので、文字列をhtmlエンコードする必要があります。PHPでは、これは関数htmlentities()またはhtmlspecialchars()で行うことができます – Erik