mysql_insert_id with update

后端 未结 2 622
无人及你
无人及你 2021-01-29 12:34

After executing the query below I use the PHP function mysql_insert_id() and it always gives me 0.

UPDATE 
    tbl_training_types 
SET 
    fld_seri         


        
2条回答
  •  生来不讨喜
    2021-01-29 12:59

    When you update a note in database you already have something using what you can identify it. In your example you already have $id which should be containing the value of data you have recently updated. If you don't have id and you try to update with name or something different after update you can simply retrieve updated data with simple query:

    select * from table_name where your condition
    

    Note: mysql_* functions are deprecated and won't be supported in future versions. You should be using either mysqli_* or PDO.

提交回复
热议问题