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 BAPI_PR_CHANGE how to add account assignment information for service line
  • ¥500 火焰左右视图、视差(基于双目相机)
  • ¥100 set_link_state
  • ¥15 虚幻5 UE美术毛发渲染
  • ¥15 CVRP 图论 物流运输优化
  • ¥15 Tableau online 嵌入ppt失败
  • ¥100 支付宝网页转账系统不识别账号
  • ¥15 基于单片机的靶位控制系统
  • ¥15 真我手机蓝牙传输进度消息被关闭了,怎么打开?(关键词-消息通知)
  • ¥15 装 pytorch 的时候出了好多问题,遇到这种情况怎么处理?