<?php
header("Content-type: text/html; charset=utf8");
$host='localhost';//数据库ip
$user=' ';//用户名
$password=' ';//密码
$dbName=' ';//要连接的数据库名
$con =new mysqli($host,$user,$password,$dbName,3308);//数据库连接
$user_id=$_GET['user_id'];
$xiangqing=$_GET['xiangqing'];
$sql="INSERT INTO `post` (`user_id`, `xiangqing`) VALUES ('$user_id','$xiangqing')";
$result = $con->query($sql);
echo mysqli_insert_id($con);
成功