I am trying to convert a mysql resource id to JSON object to be sent as a response for ajax call this is the code that I´ve tried to use
<?php
require_once 'config.php';
$sql="SELECT * FROM `inquiry` WHERE 1";
$res=mysql_query($sql);
if($res)
echo json_encode($res);
?>
and I get this error message
Warning: [json] (php_json_encode) type is unsupported, encoded as null in /home/smartco/public_html/kb/q.php on line 6
null
how can I do it