I'm attempting to write DBTNG query for a Migrate v2 class (D6), and I can't quote get a WHERE clause using IN to work. Here's the query I need:
select ngeuu.user_name, ngeu.email_address1 from nge_users ngeu inner join nge_user_to_group_tbl ngeutg on ngeu.user_id = ngeutg.user_id where ngeutg.usergroup_id IN (16, 5608, 48, 34, 22, 26, 24, 18, 28, 20, 14, 12, 6879, 36);
This query returns the appropriate amount of rows. The way I have the query written in my Migrate class is:
$query = db_select('nge_users', 'ngeu'); $query->innerJoin('nge_user_to_group_tbl', 'ngeutg', 'ngeu.user_id=ngeutg.user_id'); $query->fields('ngeu', array('user_name', 'email_address1')) $query->condition('ngeutg.user_id', array(16, 5608, 48, 34, 22, 26, 24, 18, 28, 20, 14, 12, 6879, 36), 'IN'); $query->duplicate();
but I start getting duplicate rows after 4 records, even though the query by itself doesn't return any. How do I need to change this to make it correct?
Thanks.
Steve
Hi, I'm trying to use a webform block within a node body. Everything seems to work fine, until the end when it forwards to the webform node instead of back to the page the block is embedded in. any ideas why it would do this?
Drupal 6, latest everything.
Thanks. -Don-
Perhaps it's a paste-o, but the conditions are different between these two queries. ngeutg.usergroup_id vs. ngeutg.user_id:
where ngeutg.usergroup_id IN (16, 5608, 48, 34, 22, 26, 24, 18, 28, 20, 14, 12, 6879, 36);
$query->condition('ngeutg.user_id', array(16, 5608, 48, 34, 22, 26, 24, 18, 28, 20, 14, 12, 6879, 36), 'IN');
John
On Monday Dec 19 7:39 PM, at 7:39 PM, Steve Edwards wrote:
I'm attempting to write DBTNG query for a Migrate v2 class (D6), and I can't quote get a WHERE clause using IN to work. Here's the query I need:
select ngeuu.user_name, ngeu.email_address1 from nge_users ngeu inner join nge_user_to_group_tbl ngeutg on ngeu.user_id = ngeutg.user_id where ngeutg.usergroup_id IN (16, 5608, 48, 34, 22, 26, 24, 18, 28, 20, 14, 12, 6879, 36);
This query returns the appropriate amount of rows. The way I have the query written in my Migrate class is:
$query = db_select('nge_users', 'ngeu'); $query->innerJoin('nge_user_to_group_tbl', 'ngeutg', 'ngeu.user_id=ngeutg.user_id'); $query->fields('ngeu', array('user_name', 'email_address1')) $query->condition('ngeutg.user_id', array(16, 5608, 48, 34, 22, 26, 24, 18, 28, 20, 14, 12, 6879, 36), 'IN'); $query->duplicate();
but I start getting duplicate rows after 4 records, even though the query by itself doesn't return any. How do I need to change this to make it correct?
Thanks.
Steve
[ Drupal support list | http://lists.drupal.org/ ]
Can you please send the URL to duplicate function if it is explained in D.O
On Tue, Dec 20, 2011 at 9:09 AM, Steve Edwards killshot91@gmail.com wrote:
I'm attempting to write DBTNG query for a Migrate v2 class (D6), and I can't quote get a WHERE clause using IN to work. Here's the query I need:
select ngeuu.user_name, ngeu.email_address1 from nge_users ngeu inner join nge_user_to_group_tbl ngeutg on ngeu.user_id = ngeutg.user_id where ngeutg.usergroup_id IN (16, 5608, 48, 34, 22, 26, 24, 18, 28, 20, 14, 12, 6879, 36);
This query returns the appropriate amount of rows. The way I have the query written in my Migrate class is:
$query = db_select('nge_users', 'ngeu'); $query->innerJoin('nge_user_to_group_tbl', 'ngeutg', 'ngeu.user_id=ngeutg.user_id'); $query->fields('ngeu', array('user_name', 'email_address1')) $query->condition('ngeutg.user_id', array(16, 5608, 48, 34, 22, 26, 24, 18, 28, 20, 14, 12, 6879, 36), 'IN'); $query->duplicate();
but I start getting duplicate rows after 4 records, even though the query by itself doesn't return any. How do I need to change this to make it correct?
Thanks.
Steve
[ Drupal support list | http://lists.drupal.org/ ]