in my script json_enocode is encoding string or there may be some other problem ?
first Let me show all things that i have in my configuration and codes
table structure
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
Here is string that i have updated in one row of given table
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 i am using
$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);
after encoding $r i am getting this output
[{"songs_id":"2","lyrics":null,"username":"bhavik","song_name":"some name 1","fullname":"Bhavik Thakor Garasiya"}]
UPDATE :
output of 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 ) )