search

Home  >  Q&A  >  body text

Teacher, do the update conditions set here make sense?

$map =['is_update'=> $data['is_updata]]

The is_ipdate in data is obtained from the session, and the session is obtained from the admin during login, then this $ data['is_updata] must be the same as in the table. How to verify it?

Another丶Another丶1918 days ago1253

reply all(3)I'll reply

  • 卢小强

    卢小强2019-10-12 08:31:36

    if($model::get($map)){}else{} $model is your database. Use $map to determine whether there is a corresponding value in the database

    reply
    0
  • Another丶

    There must be a database. The isupdate in the judgment condition is downloaded from the database.

    Another丶 · 2019-10-12 09:25:52
    卢小强

    Did I understand it wrong? Don't you want to verify whether the value of is_updata in SESSION and is_updata in the database are the same?

    卢小强 · 2019-10-14 09:39:11
  • Cancelreply