print json data <p>This is jquery (ajax) -> php response</p> <pre><code> {"errorInfo":["23000",1062,"Duplicate entry 'blahblah' for key 'sn'"]} </code></pre> <p>how to print out, with jquery, only "Duplicate entry 'blahblah' for key 'sn'"</p> <pre><code> success: function (html) { $("#notification").fadeIn("slow") .text(html); //Duplicate entry 'blahblah' for key 'sn'? html-&gt;errorInfo[2]? } </code></pre> <p>thank you </p> <p>UPDATE:</p> <p>It's Standard PDO Error function</p> <pre><code> catch(PDOException $e) { print json_encode($e); } </code></pre> <p>that print out like this: </p> <pre><code> {"errorInfo":["23000",1062,"Duplicate entry 'SDAAASSASADASADASDAS' for key 'sn'"]} </code></pre> <p>UPDATE:</p> <p>I change it on other side, on source, I use </p> <pre><code> print json_encode($e-&gt;errorInfo[2]); instead of print json_encode($e) </code></pre>