最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

php - How to create plugin page that reads from database

programmeradmin0浏览0评论

I am working on a WordPress website. I have a MySQL database with data in it. I want to showcase this data on my website (I already have a local PHP page that does what I want).

I have been told that the best way to do this is to create a plugin that retrieves data from the database, but I have no idea how to make one and I can't find any tutorials that involve databases.

Any tips/pointers/links to tutorials are greatly appreciated.

I am working on a WordPress website. I have a MySQL database with data in it. I want to showcase this data on my website (I already have a local PHP page that does what I want).

I have been told that the best way to do this is to create a plugin that retrieves data from the database, but I have no idea how to make one and I can't find any tutorials that involve databases.

Any tips/pointers/links to tutorials are greatly appreciated.

Share Improve this question edited Oct 10, 2019 at 13:27 butlerblog 5,1213 gold badges28 silver badges44 bronze badges asked Oct 10, 2019 at 8:47 Jessica ChambersJessica Chambers 1113 bronze badges 1
  • I would like to thank the pedants who read my question intently enough to fix my truly horrendous lack of capitalization of proper nouns (that I'm sure must have obscured the meaning of the sentence - one could easily think that I was referring to some kind of fabulous machine that presses words!) but who offer absolutely no advice as to my actual question. God bless you for your invaluable aid, this SE would collapse without you – Jessica Chambers Commented Oct 14, 2019 at 12:05
Add a comment  | 

1 Answer 1

Reset to default 1

To query a second database you can use the wpdb object like explained here.
This can be a local or extern database. You don't need to create a plugin.

发布评论

评论列表(0)

  1. 暂无评论