Php Mysql select query not working -


the below query results in following error:

sqlstate[23000]: integrity constraint violation: 1052 column 'accountid' in clause ambiguous

$select = $this->select()             ->from(array('finance_account' => db_table_prefix . 'finance_account'), array(                     'accountid',                     'parentaccountid',                     'accountgroupid',                     'accountpath',                     'accountcode',                     'accountname',                     'description'                 ))             ->joinleft(array('ac' => db_table_prefix . 'customer'), 'finance_account.accountid = ac.accountid', array())                     // using "array_unique()" minimize db overhead              ->where('accountid in (?)', array_unique($parentids))             ->setintegritycheck(false); 

i don't have other column join. supposed now?

accountid put finance_account.accountid or ac.accountid because query ambiguous on table at

$select = $this->select() ->from(array('finance_account' => db_table_prefix . 'finance_account'), array( 'accountid', 'parentaccountid', 'accountgroupid', 'accountpath', 'accountcode', 'accountname', 'description' )) ->joinleft(array('ac' => db_table_prefix . 'customer'), 'finance_account.accountid = ac.accountid', array()) // using "array_unique()" minimize db overhead ->where('ac.accountid in (?)', array_unique($parentids)) ->setintegritycheck(false);


Comments

Popular posts from this blog

android - MPAndroidChart - How to add Annotations or images to the chart -

javascript - Add class to another page attribute using URL id - Jquery -

firefox - Where is 'webgl.osmesalib' parameter? -