Go Back   vb.org Archive > vBulletin 3 Discussion > vB3 Programming Discussions
FAQ Community Calendar Today's Posts Search

Reply
 
Thread Tools Display Modes
  #1  
Old 08-24-2005, 12:38 AM
FrozenCreations FrozenCreations is offline
 
Join Date: Jul 2005
Posts: 89
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default MYSQL change user id manually

heyo, i was wandering threw my vast vast vast database looking at the user table, i went in, clicked on browse,

now, user #1 is obously the person who installed vb... and i need to change his userid form 1 to my user id (4). i tryed doing that in my spot, but when i did, all that happened was my username was changed to user#1's name if that makes any sence...

if not, ill try 2 explain it a bit more


basiclly i need 2 change the userids
Reply With Quote
  #2  
Old 08-24-2005, 12:53 AM
Guest190829
Guest
 
Posts: n/a
Default

[sql]UPDATE user
SET userid = '1'
WHERE userid = '4';[/sql]

[sql]UPDATE user
SET userid = '4'
WHERE userid = '1' AND username= 'username';[/sql]

The above two queries should work, I didn't test them. And I also don't know how this will affect your board. So be warned, and I would test it on a test board before you do it.

And Change 'username' with the username of the user you want to switch.
Reply With Quote
  #3  
Old 08-24-2005, 12:57 AM
FrozenCreations FrozenCreations is offline
 
Join Date: Jul 2005
Posts: 89
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

#1064 - You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'table user
SET userid = '1'
WHERE userid = '2'' at line 1
Reply With Quote
  #4  
Old 08-24-2005, 12:59 AM
Guest190829
Guest
 
Posts: n/a
Default

Quote:
Originally Posted by FrozenCreations
#1064 - You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'table user
SET userid = '1'
WHERE userid = '2'' at line 1
You used a double quote instead of a single quote in your where clause.
Reply With Quote
  #5  
Old 08-24-2005, 01:02 AM
FrozenCreations FrozenCreations is offline
 
Join Date: Jul 2005
Posts: 89
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

lol, whoops, and i thought i copyed it /;

SQL-query :

UPDATE user SET userid = '1' WHERE userid = '4'

MySQL said:

#1062 - Duplicate entry '1' for key 1

and shouldent i have the username 4 teh first 1 aswell?
Reply With Quote
  #6  
Old 08-24-2005, 01:05 AM
Guest190829
Guest
 
Posts: n/a
Default

The username isn't needed for the first one since there are not duplicate user-ids. For the second one however, you do need it to prevent the error your getting know.
Reply With Quote
  #7  
Old 08-24-2005, 01:07 AM
FrozenCreations FrozenCreations is offline
 
Join Date: Jul 2005
Posts: 89
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

lol, and how would i fix it?

do i out them both in?

im only putting in the first 1

should i do both?

and what username do i put in? mine or the other 1?
Reply With Quote
  #8  
Old 08-24-2005, 01:15 AM
Guest190829
Guest
 
Posts: n/a
Default

Hm...it seems the userid field must be unique. You can try first setting the user with userid 1 to have a userid that doesn't exist, then change yours to userid 1, and then change his to 4. But I don't know what effect this would have on the database and the auto_increment. Why do you need to this anyway?
Reply With Quote
  #9  
Old 08-24-2005, 01:18 AM
FrozenCreations FrozenCreations is offline
 
Join Date: Jul 2005
Posts: 89
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

i just to be #1 thats all i was on our old site... but he installed vb, (and is nolonger active)

and doing that... wouldent that change all the users posts... llike swttch em around?

al user 1's posts becoume user #4 posts... so on?
Reply With Quote
  #10  
Old 08-24-2005, 01:20 AM
Guest190829
Guest
 
Posts: n/a
Default

Quote:
Originally Posted by FrozenCreations
i just to be #1 thats all i was on our old site... but he installed vb, (and is nolonger active)

and doing that... wouldent that change all the users posts... llike swttch em around?

al user 1's posts becoume user #4 posts... so on?
Not sure, that's why I'm so iffy on doing it. I don't know the side-effects. If I were you, I'd leave myself as 4.
Reply With Quote
Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT. The time now is 08:17 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.04527 seconds
  • Memory Usage 2,238KB
  • Queries Executed 11 (?)
More Information
Template Usage:
  • (1)SHOWTHREAD
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (1)ad_showthread_beforeqr
  • (1)ad_showthread_firstpost
  • (1)ad_showthread_firstpost_sig
  • (1)ad_showthread_firstpost_start
  • (2)bbcode_quote
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)navbar
  • (3)navbar_link
  • (120)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (2)pagenav_pagelink
  • (10)post_thanks_box
  • (10)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (10)post_thanks_postbit_info
  • (10)postbit
  • (5)postbit_onlinestatus
  • (10)postbit_wrapper
  • (1)spacer_close
  • (1)spacer_open
  • (1)tagbit_wrapper 

Phrase Groups Available:
  • global
  • inlinemod
  • postbit
  • posting
  • reputationlevel
  • showthread
Included Files:
  • ./showthread.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/functions_bigthree.php
  • ./includes/class_postbit.php
  • ./includes/class_bbcode.php
  • ./includes/functions_reputation.php
  • ./includes/functions_post_thanks.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
  • showthread_start
  • showthread_getinfo
  • forumjump
  • showthread_post_start
  • showthread_query_postids
  • showthread_query
  • bbcode_fetch_tags
  • bbcode_create
  • showthread_postbit_create
  • postbit_factory
  • postbit_display_start
  • post_thanks_function_post_thanks_off_start
  • post_thanks_function_post_thanks_off_end
  • post_thanks_function_fetch_thanks_start
  • post_thanks_function_fetch_thanks_end
  • post_thanks_function_thanked_already_start
  • post_thanks_function_thanked_already_end
  • fetch_musername
  • postbit_imicons
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • postbit_display_complete
  • post_thanks_function_can_thank_this_post_start
  • pagenav_page
  • pagenav_complete
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete