search

Home  >  Q&A  >  body text

Both tables in the join query have id auto-increment fields. After querying, which table's id will be displayed?

Join query Both tables have id auto-increment fields. After querying, which table's id will be displayed?

The id fields I output all become integers 1. How to solve this?

suisui2617 days ago1154

reply all(2)I'll reply

  • PHP中文网

    PHP中文网2017-12-12 20:01:37

    You can also answer it yourself

    reply
    0
  • sui

    sui2017-12-12 15:40:45

    Answer it yourself.

    Use field('a.id') to extract the desired ID. Of course, if you want other fields, you can add the fields you want after the parentheses after the field, but you cannot enter the alias of the table. The alias of the table I used.

    reply
    0
  • Cancelreply