开发者

How can I create two related tables in MySQL and return a result set as JSON using PHP? [closed]

It's difficult to tell what is being asked here. This question is ambiguous, vague, inco开发者_如何学Pythonmplete, overly broad, or rhetorical and cannot be reasonably answered in its current form. For help clarifying this question so that it can be reopened, visit the help center. Closed 11 years ago.

I need to create two related tables in MySQL and return a result set as JSON using PHP.

I have figured out how to get my data from MySQL using PHP and how to encode it to JSON, but I'm not sure how to use Javascript to display the JSON results on my page.

Any help would be appreciated.


This is a very vague question, but here are all the pieces you'll need. Put them together in the way which solves your particular problem:

  1. Basic MySQL usage example: http://us3.php.net/manual/en/mysql.examples-basic.php

  2. Full MySQL documentation: http://us3.php.net/manual/en/book.mysql.php

  3. Getting data from related tables: http://www.keithjbrown.co.uk/vworks/mysql/mysql_p5.php (JOIN directive)

  4. Encode your data in JSON: http://php.net/manual/en/function.json-encode.php

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜