{'Id'}.'" '; $r = mysql_query($q); if(!$r){ echo '{"success": false, "error": "'.db_error($q).'"}'; } } echo json_encode($array);