Bobbo
03-10-2011, 01:26 PM
I've been racking my brain trying to figure out why I cant get this to work.
I've got a vBulletin site that is pretty heavily integrated with a few of our other internal systems. I've got a plug-in that runs at global_bootstrap_init_complete and among other things performs an update to a table if certain logic dictates.
In one scenario, if an email address has been changed in an external system, it will update the users email address in vbulletin. This works great, no problem.
The problem exists with a new feature which includes a custom table that also needs to be updated in this scenario, however my statement will not update the custom table.
The first statement works, but the second does not.
// CS changed ITSM email record. Update vB data
$vbulletin->db->query_write("UPDATE " . TABLE_PREFIX . "user SET email = '" . $vbuseremail . "' WHERE email = '" . $currentvbemail . "' LIMIT 1 ");
// Update Knowledge Base subscriptions
$vbulletin->db->query_write("UPDATE " . TABLE_PREFIX . "kb_subscribers SET subscriber_email = '" . $vbuseremail . "' WHERE subscriber_email = '" . $currentvbemail ."'");
I'm not really sure what I am missing. (probably something stupid) I have other plug-ins that insert records into my custom tables without problem. This is the first time I'm doing an update on it though.
The table and column names are all spelled correctly. *scratches head* Any ideas on what I could be missing?
********************************
Nevermind, but thanks for looking. Stupid error in my logic. (not in the code displayed here)
Sometimes I have to actually post a message before I figure out I've made a simple mistake. Guess it forces to increase my trouble-shooting scope. ;-)
I've got a vBulletin site that is pretty heavily integrated with a few of our other internal systems. I've got a plug-in that runs at global_bootstrap_init_complete and among other things performs an update to a table if certain logic dictates.
In one scenario, if an email address has been changed in an external system, it will update the users email address in vbulletin. This works great, no problem.
The problem exists with a new feature which includes a custom table that also needs to be updated in this scenario, however my statement will not update the custom table.
The first statement works, but the second does not.
// CS changed ITSM email record. Update vB data
$vbulletin->db->query_write("UPDATE " . TABLE_PREFIX . "user SET email = '" . $vbuseremail . "' WHERE email = '" . $currentvbemail . "' LIMIT 1 ");
// Update Knowledge Base subscriptions
$vbulletin->db->query_write("UPDATE " . TABLE_PREFIX . "kb_subscribers SET subscriber_email = '" . $vbuseremail . "' WHERE subscriber_email = '" . $currentvbemail ."'");
I'm not really sure what I am missing. (probably something stupid) I have other plug-ins that insert records into my custom tables without problem. This is the first time I'm doing an update on it though.
The table and column names are all spelled correctly. *scratches head* Any ideas on what I could be missing?
********************************
Nevermind, but thanks for looking. Stupid error in my logic. (not in the code displayed here)
Sometimes I have to actually post a message before I figure out I've made a simple mistake. Guess it forces to increase my trouble-shooting scope. ;-)