Mogens Melander wrote:
Well, no typos.

The relevant piece of code:

if (! $cust = mysql_fetch_assoc($res))
{
        echo "{success: false, errors: { reason: 'Fetch Customer failed: " .
                htmlspecialchars(mysql_error(),ENT_QUOTES) .
                "<br>" . htmlspecialchars($sql,ENT_QUOTES) . "'}}";
}
else
{
        echo "{success: true, total: 1, results:[" . json_encode($cust) . "]}";
}


What happens if you simplify the PHP?


$cust = mysql_fetch_assoc($res);
print_r($cust);


That will tell you what PHP is seeing from MySQL. If the results have the correct values, then the problem is elsewhere in the code.

I suspect that the problem is in the json_encode() function. According to the PHP documentation this requires utf8-encoded data. If your values in oname are not utf8, then that may explain why the function is returning a 'null' where it should have a string.

Mark


--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:    http://lists.mysql.com/mysql?unsub=arch...@jab.org

Reply via email to