dqab0824 2017-06-09 19:46
浏览 15
已采纳

动态地将值插入两个不同的数据库

I am trying to insert two values into my table using SQL: The members ID and the centre they attend. The centre table takes the Centre ID and the Members ID and links them together.

The problem is i am trying to do this via php when I add a new member (so while creating the member ID). The idea is that using the form you create the member (and an ID will be created) and add it to the members table then at the same time you insert the centre (integer) and that members ID into the Centre table

PK (auto Int)                (Linked to the members table)
CentreID         CAddress          memberID
  13                10                 1
  14                11                 2
  15                12                 3

I hope that makes some sense. I am having some trouble explaining it as i cant quite get my head around how you would do this either.

Here is a picture of my interface which is supposed to perform the operation. enter image description here

  • 写回答

1条回答 默认 最新

  • dongzheng4556 2017-06-09 19:56
    关注

    Insert into Center table then use mysql_last inert id which you can use as hidden field in the next form and then save at the time of post.

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论

报告相同问题?

悬赏问题

  • ¥20 关于#r语言#rda分析作图的问题,请各位专家解答!
  • ¥50 找回 股票行情系统的资源问题
  • ¥15 gwas 分析-plink 检查人口分层出现下面问题
  • ¥15 关于#matlab#的问题:需要 MATLAB 运行程序,对比四个多址通信方式(TDMA,FDMA,CDMA,OFDMA)的抗噪声性能
  • ¥15 有没有复现过PFENet的,如何解决?
  • ¥15 vue3使用swiper轮播图循环失败
  • ¥15 FDMA,OFDMA,TDMA 和 CDMA 系统容量对比仿真
  • ¥15 图神经网络的入侵检测
  • ¥15 工业数据采集技术+存储架构推荐
  • ¥15 GPT-SOVITS如何训练少数民族语言支持合成语音