为什么一直显示失败呢

<?php
  header("Content-Type: text/html; charset=utf-8");
  


  $advice_content=$_POST['textarea'];//post获取表单里的textarea
  $uphonenumber=$_POST['uphonenumber'];//post获取表单里的uphonenumber

  
  if(empty($uphonenumber) || empty($advice_content)){
               echo "信息不能为空";            
            }
  include('init.php');//链接数据库
  $sql="insert into yffice_advice(id,advice-content,uphonenumber) values (null,'$advice_content','$uphonenumber')";//向数据库插入表单传来的值的sql
  mysql_query("SET NAMES utf8"); 
  $result=mysql_query($sql);//执行sql
  if($result){
    echo "成功";
    }else{
    echo "失败";
    }
  mysql_close();//关闭数据库

?>

这是返回的结果:

clipboard.png

echo $sql和$result:

clipboard.png

阅读 1.7k
2 个回答

自己解决了 我把数据库的列名搞了一下就可以了 不加-

提示什么错误?把错误结果贴上来

宣传栏