[support] Manipulation of data in tables

Abhishek Nigam abhishekn at enablingdimensions.com
Thu Jan 5 06:02:54 UTC 2006


Hi,

here is my problem:

I've created a Registration form using webform in the create content section. It works fine. The data which is entered through the registration form goes into the webform_submitted_data table. The registration form is designed for 2 different newsletters; newsletter1 & newsletter2, The fields of the registration form is as Name, Address & Email etc, what I want that to extract the Email id's from the table webform_submitted_data and insert it into sn_subscriptions table for subscription list of respected newsletters in the newsletter module instead of using the subscription form of the simplenews module. 

For that I wrote certain codes here:

$mail1=db_fetch_object(db_query("select distinct data from {webform_submitted_data} where nid=250 and name='Email-ID'"));

$result=count($mail1);

for($i=1; $i<=$result; $i++)

{

db_query("INSERT INTO {sn_subscriptions} (mail, uid, a_status) VALUES ('%s', %d, %d)", $mail1, $uid, 1);

}

The problem is that it does not insert the data into sn_subscriptions table.

plz help me out.

Regards!
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.drupal.org/pipermail/support/attachments/20060105/74e45517/attachment.htm


More information about the support mailing list