Php reading textarea-php Tutorial

Source: Internet
Author: User
Php reads the textarea, submits information in the textarea text box such as online, batch submits one row at a time, how does php split them and read them row by row into the database after obtaining them, I have tried nrnr and want to know how to store the obtained data to one row in the database. Solution: ------------------ generate an SQL command string PHPcode $ arpreg php to read textarea, online
The textarea text box submits information, one row and one batch commit, how to split them after php gets them and read them into the database row by row, I tried \ n \ r none

In addition, I would like to ask how to store the obtained data together into one row of data in the database

------ Solution --------------------
Generate an SQL command string
PHP code
$ Ar = preg_splie ("/[\ r \ n] +/", $ _ POST ['text'], 0, PREG_SPLIT_NO_EMPTY ); $ SQL = "INSERT INTO tbl_name (textfield) VALUES "('". join ("'), ('", $ ar ). "')";

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.