douyan1972
2017-11-23 14:41
浏览 83
已采纳

SQL Server数据库中的空格而不是空字符串

I have this query :

$this->dbSQLServer->select("nom, '' AS prenom")
                  ->from("users");

return $this->dbSQLServer->get()->result_array();

But instead of returning me '' for the prenom, I end up with ' '.

Any ideas where the problem might come from?

图片转代码服务由CSDN问答提供 功能建议

我有这样的查询:

  $ this->  dbSQLServer-> select(“nom,''AS prenom”)
  - > from(“users”); 
 
return $ this-> dbSQLServer-> get() - > result_array();  
   
 
 

但不是为 prenom 返回'',而是以结尾 “

问题可能来自哪些想法?

  • 点赞
  • 写回答
  • 关注问题
  • 收藏
  • 邀请回答

1条回答 默认 最新

  • duanhuancong1969 2017-11-23 14:43
    已采纳

    Try the Following instead:

    $this->dbSQLServer->select("nom, Null AS prenom")
                      ->from("users");
    

    Instead of empty string use Null

    点赞 打赏 评论

相关推荐 更多相似问题