Name is
id int(3) primary key,
myname varchar(10),
age int (3)
Role table is
id int (2) primary key,
name_id(3) foreign key references Name.id
Suranme varchar(20)
Now I write a query
$select->setIntegrityCheck(false)
->from('Name',
array('Name.*', 'role_id'=>'Role.id',
)
->join('Role', 'Role.name_id = Name.id')
->group('Name.id')
echo $select->__toString();
It printd select 'Name.*', 'Role.id' as 'role_id', Role.* from Name, Role
where Name.Nid = Role.id
Now the id columns valu in Name table get overridden by id column in Role.
What can be done to avoid that?
--
View this message in context: http://www.nabble.com/overwriting-colun-problem-tp20970716p20970716.html
Sent from the Zend DB mailing list archive at Nabble.com.
没有评论:
发表评论