Database query on new user data insertion not working

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • imedic
    Member
    • Feb 2008
    • 81
    • 3.8.x

    Database query on new user data insertion not working

    With the help of a friend I manage to upload a querry (that I was intending to post it for others to use) that when a new user ID is created (a new registered user) some data will be inserted in another table that will subscribe that user to a newsletter (php list integrated with vb with another script).
    Querry is:

    Code:
    DELIMITER $$
    CREATE TRIGGER adaugareAutomata BEFORE INSERT ON `vbuser`
      FOR EACH ROW BEGIN
           INSERT INTO phplist_listuser(userid,listid,entered,modified) VALUES(NEW.userid,1,now(),now());
          INSERT INTO phplist_listuser(userid,listid,entered,modified) VALUES(NEW.userid,2,now(),now());
      END $$
    DELIMITER ;
    Unfortunately that has crashed registration of new users from forum ( I receive a DB error, not a specific one, just serious database problem).

    If someone can contribute it would be appreciated. At least where too look.

    In order for this to work you would need phplist installed in same database and a bridge script (unfortunately not available anymore).
  • Trevor Hannant
    vBulletin Support
    • Aug 2002
    • 24351
    • 5.7.X

    #2
    You should post over at www.vbulletin.org for assistance with custom coding
    Vote for:

    - Admin Settable Paid Subscription Reminder Timeframe (vB6)
    - Add Admin ability to auto-subscribe users to specific channel(s) (vB6)

    Comment

    • imedic
      Member
      • Feb 2008
      • 81
      • 3.8.x

      #3
      Found it: instead of:

      BEFORE INSERT ON `vbuser`

      you need
      AFTER INSERT ON `vbuser`

      Thank you for advice

      Comment

      widgetinstance 262 (Related Topics) skipped due to lack of content & hide_module_if_empty option.
      Working...