I would like to ask all the great gods, how do you save the special characters of Wechat"s nickname in the database
I would like to ask all the great gods, how do you save the special characters of Wechat"s nickname in the database
it is said that you can use utf8mb4, to try
set the character set of the database to utf8mb4, and then execute
set names utf8mb4
utf8mb4
if it is not feasible to change the database, you can transcode and save it, take it out and decode it
CREATE TABLE `member_data` (
`id` int(10) unsigned NOT NULL AUTO_INCREMENT,
`member_id` int(11) NOT NULL COMMENT '',
`sex` enum('0','1','2') COLLATE utf8mb4_unicode_ci NOT NULL COMMENT ' 0=> 1=> 2=>',
`nick_name` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL COMMENT '/',
`img` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL COMMENT '',
`created_at` timestamp NULL DEFAULT NULL,
`updated_at` timestamp NULL DEFAULT NULL,
PRIMARY KEY (`id`),
UNIQUE KEY `member_data_member_id_unique` (`member_id`)
) ENGINE=InnoDB AUTO_INCREMENT=125 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
look below
ENGINE=InnoDB AUTO_INCREMENT=125 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
look below
COLLATE=utf8mb4_unicode_ci
set utf8mb4_unicode_ci to store special characters directly
Database character set utf8mb4
Table character set utf8mb4, field needs to be confirmed. if your table was changed halfway instead of utf8mb4, then the previous field code is still the same. You need to manually adjust the field code
Program character set set utf8mb4
if you think it is not possible to set the program character set collate=utf8mb4_unicode_ci, just store it directly base64_encode (). Then parse it in base64_decode ()
I want to optimize a sentence about group by. I don t know where to start. I want to find a train of thought . SELECT adv_id, network_id, SUM(re_click) AS clk, SUM(deny_click) AS dny_clk, SUM(re_conver) AS re_ins, SUM(mat_conver) AS mat_ins, SUM(def_...
ask God to help me translate this native SQL statement into TP5 thank you! It is Db:: ( name )-> this kind of chained operation select a.id, a.titlerect a. Createwriting time as answer_count from fa_question a. Isometric solvepaper count (b.qid) as ...
I have a vegetable chicken at the front end. Recently, there is a new demand for the company s project, which has been maintained by others before. the front end uses a framework built by pHp and uses the memcached plug-in. After the project runs, ,...
The basic logic of the program is as follows: execute "LOCK TABLES auto_table WRITE "; then "select ID from auto_table; then update ID+1 " UPDATE auto_table set ID=ID+1 "; finally execute " UNLOCK TABLES " but this logic occurs when two users r...
php calls the stored procedure, and there is other execution code before and after the stored procedure, in the same transaction, but the code before and after the stored procedure is executed, but the code in the stored procedure is not executed. What i...
this is a function of asking and answering questions questions asked by users in Table A questions answered by users in Table B Table An is the only question corresponding to ID, Table B PID corresponds to Table An ID users answer which question PI...
the code is as follows $num = M ( log )-> where ( "date_format (create_time, %Y-%m ) = $date ")-> count ( id ); for($i = 0; ($i+5000)<=20000;$i += 5000){ $datas = M( credit_log )->where("date_format(create_time, %...
for example: I have a table T1 in which there is a comment named name name field select name from T1 that gets array (). [0]=array( name => 123 ), [1]=array( name => 236 ) ) how to change the above name to name ...
browser error: SQLSTATE [HY000] [1045] Access denied for user root @ localhost (using password: NO) I successfully connected to the database with navicat, the user name is root, password is the password set when installing mysql, and the framework...
how do you design database fields like youtube pages that show whether you have pressed like or dislike? And go to the database to judge when the user arrives at the page? whether the design idea is like this Post table id picroute likeusers dislik...
when learning the knowledge of mysql penetration, the attempt to read the file on disk D with sql statement failed as follows: root@host after testing, the value of secure-file-priv is not valid even if it is empty. mysql,apache is running normal...
backend PHP sends the submitted data to Filter submit data: "> < script > alert ( 1 ) < script > Filter (equivalent to conversion via htmlspecialchars): "> < script > alert ( 1 ) < script > name varchar (255) description text prom...
as shown in the figure, how to get to the quotation marks on both sides of the queue and return the data in array format ...
after the order exceeds a certain time, the user does not confirm the receipt, so the system needs to automatically complete the confirmation operation, that is, to change the status of the order. Do you have any good ideas? I have seen before that so...
php backend needs to insert records into the mysql database table. The id of this table is primary key but not self-growing, which needs to be calculated by some rules. For example, if you first check that there are N records created that day, then set t...
< H2 > hierarchical relationship table (processed using baum) < H2 > when the distributor buys, the performance automatically adds up to all his superiors monthly performance the settlement method determines whether the minimum settlement ra...
it is necessary to build a php integrated development environment on this machine. Whether it can be deployed in the cloud can be found directly through the public network ip! ...
A a_id a_title a_key a_desc a_pid 1 A A A 1 B b_id b_title b_key b_desc b_pid 1 b 2 C c_id c_title c_key c_desc c_pid 1 $title= Ctitile || ...
SessionHandler.php the contents of the file are as follows <?php namespace Dry Base; class SessionHandler{ private $pdo = null; private $lifeTime = 1440; public function __construct($pdo) { $this->pdo = $pdo; ...
I wrote an api hypothesis called sql.php myself. I am in another sql-test.php $data = array( "errno" => 1 , "errstr" => 2 , "errfile" => 3 , "errline" => 4 ); $data_string = js...