duanlongling5308 2011-10-19 16:57 采纳率: 0%
浏览 46

如何从不同主机上的两个数据库中获取PHP数据并将它们放在一个html表中?

I have to put the data into a php page from the databases which are in seperate hosts. The one workaround i can think of is getting the data from both the databases onto an array and then displaying it. What if the array is multi dimensional? How to merge data from two databases on two different hosts in PHP? I am using PHP5.

Specifics: I am working on a booking engine. There are booking pages for each state and databases for each of them on different hosts.I am working on creating a kind of summary page for staff, which shows the bookings done for all the states in a single page. They need it for internal use. The booking table in each of the database has same no.of rows. I need to know how merge the arrays obtained from these databases and then display it in a single web page.

  • 写回答

3条回答 默认 最新

  • dota220141003 2011-10-19 17:01
    关注

    1) Connect to first database
    2) Fetch and save the data in an array
    3) Connect to second database
    4) Fetch and save the data in the same array
    5) Loop through the array and display results

    评论

报告相同问题?

悬赏问题

  • ¥15 关于大棚监测的pcb板设计
  • ¥15 stm32开发clion时遇到的编译问题
  • ¥15 lna设计 源简并电感型共源放大器
  • ¥15 如何用Labview在myRIO上做LCD显示?(语言-开发语言)
  • ¥15 Vue3地图和异步函数使用
  • ¥15 C++ yoloV5改写遇到的问题
  • ¥20 win11修改中文用户名路径
  • ¥15 win2012磁盘空间不足,c盘正常,d盘无法写入
  • ¥15 用土力学知识进行土坡稳定性分析与挡土墙设计
  • ¥15 帮我写一个c++工程