PHP的新手,并坚持错误(解析错误:语法错误,意外的$'message'(T_VARIABLE)

时间:2019-06-21 04:03:11

标签: php mysql

开始会话

session_start();

$userid = $_SESSION["Id"];
$name = $_SESSION["name"];
$pr = $_SESSION["profilepicture"];

include 'config/config.php';
include 'config/config1.php';
include 'config/connect.php';

$IDMail = $_POST['IDMail']
$Message = $_POST['Message']
$userid = $_POST['userid']

$time = time();

mysql_query("INSERT INTO mail (IDMail, IDUser, Time, Message) VALUES ('$IDMail','$IDUser','$time','$message')")  or die("error in insert please".mysql_error());

2 个答案:

答案 0 :(得分:2)

您已经在第11到13行的末尾错过了分号。

答案 1 :(得分:0)

在其中分配$ _POST属性的所有三行后都需要一个分号。

$IDMail =$_POST['IDMail']

$Message = $_POST['Message']

$userid = $_POST['userid']

应该是

$IDMail =$_POST['IDMail'];

$Message = $_POST['Message'];

$userid = $_POST['userid'];