mysqli_select_db($this->con,"my_db");$sql = "insert into message(username,content,lasttime)VALUES ('$username','$content','$time')";$username 等变量一定要有单引号。