PHP, MYSQL and amp; JSON

Ok, So I’m using AJAX to pull some information from my MYSQL database and put it onto the screen. The thing is I cannot understand JSON for the life of me. Can you suggest any tutorials or anything that will help?

I mean I get that I can encode my query via JSON but I guess it’s the javascript side I do not understand.

Here’s my quick tutorial:

JSON is a means for expressing data for arrays, objects, and their contents. It has nothing to do with object behaviour (methods).

hello;
    }
}
?>

This class would in JSON would look like:

var obj = {
   "hello": "hello",
   "something": ["hello1", "hello2"]
};

As you can see, JSON is similar to maps in a lot of languages (key/value pairs). You can also see, that only data is represented. JSON is also shorthand for JavaScript builtins. For example, this previous object can be written in JavaScript like so.

var obj = new Object();
   obj.hello = "hello";
   obj.something = new Array("hello1", "hello2");

Hope this gives you a little idea of what JSON is about.

Hello, buddy!责编内容来自:Hello, buddy! (源链) | 更多关于

阅读提示:酷辣虫无法对本内容的真实性提供任何保证,请自行验证并承担相关的风险与后果!
本站遵循[CC BY-NC-SA 4.0]。如您有版权、意见投诉等问题,请通过eMail联系我们处理。
酷辣虫 » 后端存储 » PHP, MYSQL and amp; JSON

喜欢 (0)or分享给?

专业 x 专注 x 聚合 x 分享 CC BY-NC-SA 4.0

使用声明 | 英豪名录