douyan1972
douyan1972
2017-11-23 14:41

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?

  • 点赞
  • 写回答
  • 关注问题
  • 收藏
  • 复制链接分享
  • 邀请回答

1条回答

  • duanhuancong1969 duanhuancong1969 4年前

    Try the Following instead:

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

    Instead of empty string use Null

    点赞 评论 复制链接分享