Welcome Guest, Not a member yet? Register   Sign In
Active record select problem
#2

[eluser]clive_turner[/eluser]
Had similar problems with CONCAT and Date_Format. The issue is the commas in SELECT clauses. Active Record explodes the SELECT clause using "," as a delimiter, to turn the string into an array of fields. While this works with simple select statements like col1, col2, col 3, it produces strange results with any SELECT statement that contains a comma eg CONCAT and DATE_FORMAT.

The solution is to enter the SELECT fields as an array and not as a string, so it bypasses the explode function.

ie
Code:
$select=array("CONCAT( HouseNo, ',  ' , Address1 ) AS Property",
         "property.PropertyId");
  
  $this->db->select($select);



Messages In This Thread
Active record select problem - by El Forum - 10-31-2012, 01:25 AM
Active record select problem - by El Forum - 11-02-2012, 12:49 AM
Active record select problem - by El Forum - 11-02-2012, 01:28 AM



Theme © iAndrew 2016 - Forum software by © MyBB