$sql = "INSERT INTO q_user(username,pic)value('xiaowen','123456')"; mysql_query($sql, $connect); $id = mysql_insert_id();//获取插入id