vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vB4 Programming Discussions (https://vborg.vbsupport.ru/forumdisplay.php?f=252)
-   -   One query_write works and one doesnt (https://vborg.vbsupport.ru/showthread.php?t=260165)

Bobbo 03-10-2011 01:26 PM

One query_write works and one doesnt
 
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.
Code:

// 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. ;-)

Lynne 03-10-2011 03:56 PM

LOL

Glad you got it figured out. :)


All times are GMT. The time now is 02:48 PM.

Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.

X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.01003 seconds
  • Memory Usage 1,710KB
  • Queries Executed 10 (?)
More Information
Template Usage:
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (1)bbcode_code_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (2)printthreadbit
  • (1)spacer_close
  • (1)spacer_open 

Phrase Groups Available:
  • global
  • postbit
  • showthread
Included Files:
  • ./printthread.php
  • ./global.php
  • ./includes/init.php
  • ./includes/class_core.php
  • ./includes/config.php
  • ./includes/functions.php
  • ./includes/class_hook.php
  • ./includes/modsystem_functions.php
  • ./includes/class_bbcode_alt.php
  • ./includes/class_bbcode.php
  • ./includes/functions_bigthree.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • printthread_start
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete