<?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())";
}
?>
解决方案 »
- php 中关于类的调用出错supplied argument is not a valid MySQL-Link resource in
- 我在自己的机子上安装了apache 其他的机子可以访问我的这个网站吗?地址是我的IP地址吗?
- 关于&符号
- 谁有 IP查询系统的原代码啊 要最新最全的IP库
- mssql_query功能执行多次为什么就不行呢?
- 求源代码:是一个很普遍的提交表格:浏览者填完资料后,点提交我能收到。(最好不要涉及数据库,简单点好)
- [讨论]大学里有没有可能开设PHP的课程?为什么?
- ImageTTFText为何显示为汉字乱码,我需要注意什么才可以避免呢,
- 这段代码怎么拉?
- 求助,bugfree使用查询条件出现警告,提示Invalid argument supplied for foreach() in
- 关于$sql的插入语句
- 正则中关于posix和perl的小问题
<?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());
}
?> 这样,别把php和mysql弄混了
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())";
}
?>
<?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())";
}
?>