It is safe to use $mysqli->insert_id for assign topic to post in a forum script?

后端 未结 1 725
面向向阳花
面向向阳花 2021-01-25 05:44

I\'ve a forum script that makes for every new topic a \"container\" and assign to it each post linked to the topic.

So, when I open a new topic my script makes a new row

1条回答
  •  说谎
    说谎 (楼主)
    2021-01-25 06:05

    Yes it is safe.
    Each PHP process uses separate connection and this variable contains inserted id from this very connection

    0 讨论(0)
提交回复
热议问题