Hey guys,
I am having some trouble with json_decode...
I used json_encode to encode a string that is the following:
{"id":"121","firm":"DSD","address":"Test","address2":"Test","city":"Test","region":"Test","postcode":"Test","countryid":"13","firmtype":"Marketing","phone":"01545454587","fax":"","email":"dan@test.com","url":"http://www.test.com","mainuser":"Dan","contacts":"dan@test.com","info":"","numstaff":"15","numoffices":"1","disc":"","cat":"{"35":"1"}"}
And I am using this php code to try and get it back into an array... however its just not working... the print_r(); doesnt echo anything out at all... help pleaseee!!
PHP:
if(isset($_GET['id'])){
$arraydata = mysql_fetch_assoc(mysql_query("SELECT * FROM `changelog` WHERE `id` = '".$_GET['id']."'"));
$newdata = json_decode($arraydata['newda'], true);
$olddata = json_decode($arraydata['orig'], true);
print_r($newdata);
}
Dan