我在php的拼写的sql语句,输入后是这样的select * from `zx_solutions` where s_id = 6把这条语句放在数据库中执行,报以下错误:
[SQL] 
select * from `zx_solutions` where s_id = 6[Err] 1054 - Unknown column '6' in 'where clause'请高手指点:

解决方案 »

  1.   

    select * from `zx_solutions` where `s_id` = 6
    这样
      

  2.   

    function getsolutionbyid($sid) {
    $sql = "select * from zx_solutions where s_id = $sid";
    echo $sql;
    $rs = $this->db->query($sql);
    return $rs;
    }
      

  3.   

    运行上面代码报错吗?
    你用的什么数据库,zx_solutions 表结构是怎样的。最好全部列出来。
      

  4.   

    你换一个工具运行试一试,还不行的话估计是mysql的问题了,也只能这么解释了
      

  5.   

    `zx_solutions` 确定是``这个符号吗?
      

  6.   


    select * from '表名' where 字段名 = '6'有可能是符号打错了
      

  7.   

    select * from `zx_solutions` where `s_id` = '6'
      

  8.   

    試試這個function getsolutionbyid($sid) {
      $sql = "select * from zx_solutions where s_id =".intval($sid);
      echo $sql;
      $rs = $this->db->query($sql);
      return $rs;