PHP系统查询,修改,删除可实现。插入数据无法实现

session_start();include"../inc/chec.php";include"../conn/conn.php";include"../inc/fun... session_start();
include "../inc/chec.php";
include "../conn/conn.php";
include "../inc/func.php";
$sqlstr = "insert into tb_person values('','".$_POST['p_title']."','".$_POST['p_content']."',now(),'".$_POST['p_type']."')";
$result = mysql_query($sqlstr,$conn);
re_message($result,"p_manage.php");
?>

<?php
if (!session_id()) session_start();
function w_log($act){
$filename = "./admin/log.txt";
$f_open = fopen($filename,"a+");
$str = $_SESSION['u_name'].",".date("Y-m-d H:i:s").",".$_SERVER['REMOTE_ADDR'].",".$act."\n";
fwrite($f_open,$str);
fclose($f_open);
}
function getGroup($conn,$uname,$ugroup){
$sqlstr = "select u_member from tb_group where id = ".$ugroup;
$result = mysql_query($sqlstr,$conn);
$rows = mysql_fetch_row($result);
$num = explode(",",$rows[0]);
$bool = false;
for($i = 0;$i < count($num);$i++){
if($uname == $num[$i])
$bool = true;
}
return $bool;
}

function get_tp($conn){
$sqlstr = "select f_type from tb_list group by f_type order by id";
$result = mysql_query($sqlstr,$conn);
return $result;
}

function read_field($conn,$tablename,$fieldname,$n_id){
$sqlstr = "select ".$fieldname." from ".$tablename." where id = ".$n_id;
$result = mysql_query($sqlstr,$conn);
$rows = mysql_fetch_row($result);
return $rows[0];
}

function re_message($result,$l_address){
if($result)
echo "<script>alert('操作成功!');location='".$l_address."';</script>";
else
echo "<script>alert('系统繁忙,请稍后再试');history.go(-1);</script>";
}
?>
然后就是输入信息后跳转出提示:系统繁忙,请稍后再试。而且数据库中没有信息的录入。
展开
 我来答
紫风影杀
2014-04-22 · 超过23用户采纳过TA的回答
知道答主
回答量:84
采纳率:0%
帮助的人:20.1万
展开全部
把你的插入SQL打印,然后到Mysql命令行去运行看看,,,估计的sql有问题
追问
sql运行没有错误的
推荐律师服务: 若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询

为你推荐:

下载百度知道APP,抢鲜体验
使用百度知道APP,立即抢鲜体验。你的手机镜头里或许有别人想知道的答案。
扫描二维码下载
×

类别

我们会通过消息、邮箱等方式尽快将举报结果通知您。

说明

0/200

提交
取消

辅 助

模 式