R Bayo
R Bayo

Reputation: 69

White space instead of empty string from SQL Server database

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?

Upvotes: 0

Views: 146

Answers (1)

mega6382
mega6382

Reputation: 9396

Try the Following instead:

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

Instead of empty string use Null

Upvotes: 1

Related Questions