Home  >  Q&A  >  body text

How can mysql obtain the ID based on the input field data? ?

I want to enter "Wang Lun" and "Lin Chong" when entering the data in Table 3, and then directly change it to the ID of Table 1 and Table 2 on the third side of Table 3. How to do this has troubled me for several days. Yes, please help

大印大印1650 days ago1013

reply all(2)I'll reply

  • 昨日

    昨日2020-03-26 15:31:01

    Do not enter a name, just make a select, the value is id

    reply
    0
  • 大印

    大印2020-03-23 20:54:05

    This is the table structure

    Table 1 uid uname

    1 Song Jiang

    2 Li Kui

    3 3 Lin Chong

    Table 2 tid tname

    1 Fight against Wang Lun

    2 Attack Zhujiazhuang

    3 Conquer Fangla

    Table 3 sid uid tid

    1 1 2

    2 1 3

    3 3 1

    4 3 2

    5 2 3  

    reply
    0
  • Cancelreply