개발! 딱 깔끔하고 센스있게!

php-mysql 데이터베이스 텍스트 영역 저장 줄넘기기 본문

개발 스크랩 메모/PHP

php-mysql 데이터베이스 텍스트 영역 저장 줄넘기기

렉사이 2020. 12. 28. 22:42

나의 입력 텍스트 영역이 있는데, 나는 사용자를 데이터베이스에 있는 텍스트 영역에서 사용한 연결 메모리를 저장하기 위해서, 이것은 텍스트와 같은 방식으로 출력 텍스트를 표시할 수 있습니다

예:

Some text some text some text some text new line some text some text new line new line some text new line some text 

현재 스크립트를 다운로드합니다:

$sql = "insert into people (price, contact, category, username, fname, lname, expire, filename) values (:price, :contact, :category, :user_id, :fname, :lname, now() + INTERVAL 1 MONTH, :imagename)"; $q = $conn->prepare($sql) or die("failed!"); $q->bindParam(':price', $price, PDO::PARAM_STR); $q->bindParam(':contact', $contact, PDO::PARAM_STR); $q->bindParam(':category', $category, PDO::PARAM_STR); $q->bindParam(':user_id', $user_id, PDO::PARAM_STR); $q->bindParam(':fname', $fname, PDO::PARAM_STR); $q->bindParam(':lname', $lname, PDO::PARAM_STR); $q->bindParam(':imagename', $imagename, PDO::PARAM_STR); $q->execute(); 

대답

텍스트 영역에서 바꾸는 문자는 줄 바꾸기, 예를 들어, 이 문자는 HTML 로 나타날 수 없습니다.

이 문자는 HTML을 사용하지 않으면 출력을 표시할 수 없습니다.

< textarea > 또는 < pre > 태그를 표시할 수 있으며, nl2br () 를 새로 바꾸어 < br > 태그를 HTML 로 표시할 수 있습니다.

Comments