<?php
include("common.php");
if($_POST["submit"])
{
echo $sql="insert into message (id,username,title,password,sex,content,lastdate) values ('', '$_POST[username]','$_POST[title]','$_POST[password]','$_POST[sex]','$_POST[content]',now())";
}
?>
include("common.php");
if($_POST["submit"])
{
echo $sql="insert into message (id,username,title,password,sex,content,lastdate) values ('', '$_POST[username]','$_POST[title]','$_POST[password]','$_POST[sex]','$_POST[content]',now())";
}
?>
解决方案 »
- fckeditor报错 不能建立文件夹,大家帮帮忙!
- 请教高手!下载好了Apache请问如何配置Apache?谢谢!
- UNIX_TIMESTAMP() 疑问
- php 数据库 导出数据 再赋值的问题,一下说不清楚,高手进来看看吧。谢谢了
- php中设置include_path跟apache中设置include_path有什么区别
- 我的群! 25229487 春哥PHP开发群
- 要使用mambo做个系统,不知道这里有没有研究Mambo的应用的,交流下
- __destruct析构函数的用途
- 大仙们帮我看看这个mail函数吧,郁闷啊:(
- 如何根据库中该条记录的ID值来得到该条记录的所有值??小弟先谢~
- 桌面搜索不能索引php文件内容?
- 如果输入全部是特殊字符 该怎么处理
include("common.php");
if($_POST["submit"])
{
echo $sql="insert into message (id,username,title,password,sex,content,lastdate) values (\"\",\"{$_POST[username]}\",\"{$_POST[title]}\",\"{$_POST[password]}\",\"{$_POST[sex]}\",\"{$_POST[content]}\",now())";
}
?>
所以上面的SQL语句写成:
<?php
include("common.php");$username = $_POST['username'];
$title = $_POST['title'];
$password = $_POST['password'];
$sex = $_POST['sex'];
$content = $_POST['content'];
$lastdate = now();
//id一般是自增的,不用显式指定
if($_POST["submit"])
{
echo $sql=insert into message (username,title,password,sex,content,lastdate) values ("$username","$title","$password","$sex","content","$lastdate");
}
?>
echo $sql="" //后面要加到引号里