Welcome Guest, Not a member yet? Register   Sign In
generate->table datas missing with join request
#5

Sorry, I thought I replied to this earlier, but I must have gotten pulled away while I was composing my response. You need to set aliases in your select statement if you want both columns displayed because PHP arrays require unique keys (and objects require unique property names), so the second instance of a column name will overwrite the value of the first instance.

If you want everything to be dynamic, you could generate the aliases as a combination of the table name and the column name (for example: "{$table_name}.{$column_name} as {$table_name}_{$column_name}"). You could just loop through the result of list_fields() adding each alias to an array, then pass the array to $this->db->select().
Reply


Messages In This Thread
RE: generate->table datas missing with join request - by mwhitney - 10-12-2015, 08:45 AM



Theme © iAndrew 2016 - Forum software by © MyBB