关于$sql的插入语句 sql 语句应该是一个字符串,你这个明显是语法错误~~~ 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 "$_POST[username]"这类属于字符类型的改为'".$_POST['username']."'这样试试:$sql = insert into `message (id,username,title,password,sex,content,lastdate) values('','".$_POST['username']."','".$_POST['title']."','".$_POST['password']."','".$_POST['sex']."','".$_POST['content']."',now());` 我帮你改正了,自己看看那里不一样吧<?phpinclude("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())";}?> 呵呵,严重的格式错误。用楼上的和我回答的都可以。<?phpinclude("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())";}?> 还有,数组的索引需要引号括住。(根据http://topic.csdn.net/u/20090208/17/38d220f6-bdf7-41b3-866c-03615cc9ab3f.html3楼的提醒)最终代码:<?phpinclude("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上传文本文件后的查看 类似百度的搜索是不是用如下方法做的? <img src=http://x.x.x.x/stat.php?name=变量>的问题 数据库乱码 哪位解决过 Php & sql server 2000 图片存储在数据库中和图片查询问题? 大家好啊,问一下,怎么用php实现。。。。。。 unix下面怎么用php连接oracle(远程)? PHP总价格调用出数量 怎么 做 高手 帮忙下 100分 求按位异或bcc算法代码 php5操作oracle9i中文数据出现乱码 散分,我升星了,变成专家了
这样试试:
$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())";
}
?>
呵呵,严重的格式错误。用楼上的和我回答的都可以。
<?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
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())";
}
?>