Home > Backend Development > PHP Tutorial > 制作PHP+MYSQL留言板代码出错。

制作PHP+MYSQL留言板代码出错。

WBOY
Release: 2016-06-06 20:35:04
Original
1241 people have browsed it

是什么原因啊?

include("conn.php");

if($_POST['sumbit'])(

echo $sql="insert into message (id,user,title,content,lastdate) " .
"values('','$_POST[user]','$_POST[title]','$_POST[content]',now())";
)

用户:
标题:
内容:

在浏览器情况下
( ! ) Parse error: syntax error, unexpected 'echo' (T_ECHO) in C:\demo\test01\de\add.php on line 6

回复内容:

是什么原因啊?

include("conn.php");

if($_POST['sumbit'])(

echo $sql="insert into message (id,user,title,content,lastdate) " .
"values('','$_POST[user]','$_POST[title]','$_POST[content]',now())";
)

用户:
标题:
内容:

在浏览器情况下
( ! ) Parse error: syntax error, unexpected 'echo' (T_ECHO) in C:\demo\test01\de\add.php on line 6

额,if的代码段难道不是用大括号吗?你用小括号干嘛?

<code>include("conn.php");

if($_POST['sumbit'])(

$sql="insert into message (id,user,title,content,lastdate) " .
"values('','$_POST[user]','$_POST[title]','$_POST[content]',now())";

echo $sql;

)
</code>
Copy after login
Related labels:
php
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template