这是我的sql:
INSERT INTO comments (createdate,userid,profileid,comment,status)
VALUES (1449503167,65704,65704,'@Mr_S66 Wish I was There For The Xmas Party I Miss My Studio 66 Family 😜',15)
Run Code Online (Sandbox Code Playgroud)
这是我的评论架构:
+------------+---------------+------+-----+---------+----------------+
| Field | Type | Null | Key | Default | Extra |
+------------+---------------+------+-----+---------+----------------+
| commentid | int(11) | NO | PRI | NULL | auto_increment |
| parentid | int(11) | YES | | 0 | |
| refno | int(11) | YES | | 0 | |
| createdate | int(11) | YES | …Run Code Online (Sandbox Code Playgroud) 我有一个包含中文文章列表的数据库,当我尝试查询以获取所有文章名称时遇到问题,我看到的只是 ??? 而不是中文文本。
my $db_connection = DBI->connect("DBI:mysql:host=localhost;database=articles", 'root', '');
my $con = $db_connection->prepare( "select * from articles" );
$con->execute;
while (my $infoD = $con->fetchrow_hashref())
{
$INFO{$infoD->{name}} .= decode('utf8', $infoD->{name});
}
Run Code Online (Sandbox Code Playgroud)