Fix PHP/JS Script

I have a script that pulls a dataset from a mysql database. It then converts it into a json object.

My javascript pulls a new item every 5 seconds. The script works ok when the json is properly formed. But when I pull it out of the db and use PHP's json_encode() it doesn't encode it properly, I think.

Script works when I have:

var data = {

posts: [


body: "Excellent, 5 stars!"



body: "Poor, 0 stars"



body: "Beyond Excellent, 10 stars!"




and this is the code that PHP's json_encode() gives:

var data = {


{"post":{"phone":"+15555555555","status":"0","body":"http:\/\/[url removed, login to view]"}},

{"post":{"phone":"+15555555555","status":"0","body":"http:\/\/[url removed, login to view]"}},

{"post":{"phone":"+15555555555","status":"0","body":"[url removed, login to view]"}},

{"post":{"phone":"+15555555555","status":"0","body":"this is a longer test"}},


I need to have the body text fade in and out. Attached is the script. One version working (static json elements) and another not working (pulling from the DB). I need to be able to pull from the DB. Shouldn't take the right person maybe 10 minutes to fix I assume. I can give access to the server with the mysql db to get it working.

PHP version: 5.2.4

Evner: jQuery / Prototype, PHP

Se mere: test my javascript, test js, my fix com, google js, get prototype, get my fix, beyond com, php.js, php is object, php json , json script, JSON PHP, js script, jquery script, jquery fix, fix-access/, fix php, fix database, fix a c++ script, data pulling, data encode, body works, server prototype, use php, fix database access

Om arbejdsgiveren:
( 14 bedømmelser ) Guyton, United States

Projekt ID: #931958

Tildelt til:


Please check PM.

$30 USD in 0 dage
(28 bedømmelser)

7 freelancere byder i gennemsnit $47 på dette job


lets do it ...

$30 USD in 0 dage
(124 bedømmelser)

please see pm

$30 USD in 0 dage
(96 bedømmelser)

Hi, I can help you, Plz view your PMB.

$30 USD in 0 dage
(77 bedømmelser)

I could help you.

$30 USD på 1 dag
(18 bedømmelser)

Hi sir I m ready to start immediately.##### PLEASE CHECK PMB ##### Thanks.

$30 USD på 1 dag
(10 bedømmelser)

I'm expert on this kind of work, ready to start now. Thank you.

$150 USD in 0 dage
(4 bedømmelser)

Can fix it quick as I already did similar. Please check PM.

$30 USD på 1 dag
(0 bedømmelser)