4

在我的脚本中 json_enocode 是编码字符串还是可能有其他问题?

首先让我展示一下我的配置和代码中的所有内容

表结构

CREATE TABLE `dc_songs` (
 `songs_id` int(11) NOT NULL AUTO_INCREMENT,
 `username` varchar(50) NOT NULL,
 `song_name` varchar(2000) NOT NULL,
 `lyrics` text NOT NULL,
 `created_time` datetime NOT NULL,
 `is_deleted` tinyint(4) NOT NULL,
 `delete_reason` text NOT NULL,
 PRIMARY KEY (`songs_id`)
) ENGINE=InnoDB AUTO_INCREMENT=4 DEFAULT CHARSET=latin1

这是我在给定表的一行中更新的字符串

UPDATE `dc_songs` SET `lyrics` = 'Your account privacy is very important to us. You are like our family member. You can manage all your content via privacy settings. Content with privacy settings public visible to every user of this web site. You must read how content will be displayed according to your privacy in Help Section. 2.Safety

We do our best keep this web site safe but this not always depend on us, for that you will need to follow this safety Rules.

    You will not post content that is copyrighted or Unauthorized
    You will not use someone’s account
    You will not irritate users in anyways.
    You will not upload content like virus or spam.
    You will not share content that can hate someone, threatening, or pornographic.
    You will not do act that can affect this web site.
    You must provide all your original details.
    You will not use, download or share someone’s content like personal information, photographs, videos or any other that is not yours.
    You will not force user to do act that make our samaj down.
    You will not force user to fight against your enemy.
    You will not encourage people to do violence.
    You will not use this web site to do anything unlawful, misleading, malicious, or discriminatory. ' WHERE `dc_songs`.`songs_id` = 2;

我正在使用的查询

$query = "SELECT songs_id,lyrics,s.username,song_name,p.fullname
            FROM dc_songs s
            LEFT JOIN profile p ON p.username=s.username
            ORDER by songs_id DESC";
        $r=$db->run($query);

编码 $ri 后得到这个输出

[{"songs_id":"2","lyrics":null,"username":"bhavik","song_name":"some name 1","fullname":"Bhavik Thakor Garasiya"}]

更新 :

print_r($r) 的输出;

Array ( [0] => Array ( [songs_id] => 2 [lyrics] => Your account privacy is very important to us. You are like our family member. You can manage all your content via privacy settings. Content with privacy settings public visible to every user of this web site. You must read how content will be displayed according to your privacy in Help Section. 2.Safety We do our best keep this web site safe but this not always depend on us, for that you will need to follow this safety Rules. You will not post content that is copyrighted or Unauthorized You will not use someone’s account You will not irritate users in anyways. You will not upload content like virus or spam. You will not share content that can hate someone, threatening, or pornographic. You will not do act that can affect this web site. You must provide all your original details. You will not use, download or share someone’s content like personal information, photographs, videos or any other that is not yours. You will not force user to do act that make our samaj down. You will not force user to fight against your enemy. You will not encourage people to do violence. You will not use this web site to do anything unlawful, misleading, malicious, or discriminatory. [username] => bhavik [song_name] => some name 1 [fullname] => Bhavik Thakor Garasiya ) ) 
4

1 回答 1

1
于 2012-10-25T18:58:36.837 回答