我在同一页面中有两个表单,第一个表单将包含email
,name
,password
等。
第二种形式是qualification
,skills
,institution
等。
我将把第一种形式的数据添加到一个表中。我想从第一种形式获取数据的ID,并将qualifications
,skills
和institution
与第一种形式的ID一起添加到另一个表中。
我正在用php做这个。请给我一个想法,如何实现。
答案 0 :(得分:0)
尝试使用Ajax
用户输入电子邮件,通过..etc,然后在触发带有表单数据的Ajax Call之后单击提交按钮。将数据存储在表中并返回Mysql Last Inserted ID。将最后插入的ID存储在加载的JS变量/ HTML隐藏值中。
步骤:
- User Enters Details and press Submit button
- Ajax call triggers with your data
- get Last Insert id from back-end(ajax response)
- store id in html hidden value or js variable
- use this details for next form