Home  >  Article  >  Backend Development  >  jquery+php查询数据库兑现json的例子

jquery+php查询数据库兑现json的例子

WBOY
WBOYOriginal
2016-06-13 11:10:19855browse

jquery+php查询数据库实现json的例子
哪位有这方面的例子?最近急需这方面的材料


------解决方案--------------------
参考
------解决方案--------------------
test.php
exit(json_encode(array('i1'=>'1','i2'=>'2',)));


jquery ajax请求
$.getJSON(
  "test.php",
  function(json){
    alert("JSON Data:   " + json.i1);
  }
);  

具体的详细的可以查看jquery手册
------解决方案--------------------
数据库查询就查看php手册吧
------解决方案--------------------
test.php
exit(json_encode(array('i1'=>'1','i2'=>'2',)));


jquery ajax请求
$.getJSON(
  "test.php",
  function(json){
  alert("JSON Data: " + json.i1);
  }
);  
Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn