PHP (20140509)

Ajax传多个值的方法:

var title = document.getElementById("title").value;
        var cont = document.getElementById("cont").value;
        var user = document.getElementById("user").value;

        xmlHttp.open("GET","insertDate.php?title="+title+"&cont="+cont+"&user="+user,true);

获取最新插入id的函数:

Mysql_insert_id();

返回给定的 link_identifier 中上一步 INSERT 查询中产生的 AUTO_INCREMENT 的 ID 号。如果没有指定 link_identifier,则使用上一个打开的连接。

如果上一查询没有产生 AUTO_INCREMENT 的值,则 mysql_insert_id() 返回 0。如果需要保存该值以后使用,要确保在产生了值的查询之后立即调用 mysql_insert_id() 。 

原文地址:https://www.cnblogs.com/sunshine-c/p/3719822.html