如何一次在两个表中进行最后一次插入

时间:2018-02-27 05:59:06

标签: php mysql sql

这是我试过的查询,

$result = "INSERT INTO task_assign(assigned_to,assigned_by,end_on,task_title,task_desc,priority,task_status,history_assigned) VALUES('$assignTo','$assignBy','$endOn','$title','$description','$priority','$status','$assignTo')";

mysql_query("INSERT INTO notification(title,description,priority,category_id,assignment_type,sender_id,receiver_id,date_time)
    VALUES('$title', '$description', '$priority', '$category_id', '1', $assigassignTonBy, $assignTo, NOW())
    ");
    //this return only task_assign
    echo $rowId = mysql_insert_id(); 

如何从表中获取最后一个插入ID?

0 个答案:

没有答案