How to put arrays into the database (database gbk encoding)

Source: Internet
Author: User
How to put the array into the database (database gbk encoding) This post is finally edited by cnaaa8 from 2013-06-3019: 10: 30 to an existing array. the content in the array is not fixed, therefore, the implode method is discarded to convert the array into strings for saving. because the database encoding is gbk, the array converted to json format is also abandoned, how to put json into the database (database gbk encoding) must be a UTF-8 array)
At the end of this post, cnaaa8 edited an existing array at 19:10:30. the content in the array is not fixed. Therefore, the implode method to split the array is discarded and converted to a string for saving because the database encoding is gbk, if you convert an array to json format, the json format must be UTF-8. if you convert it to json and convert it to gbk with iconv, then when you read the data, iconv will report an error in reverse conversion of some data. if serialization is used, I heard that the serialization fails when some arrays are used, so I gave up. What other methods can I do:
------ Solution --------------------
Serialization is better. try it.

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.