Go Back   vb.org Archive > vBulletin 3 Discussion > vB3 Programming Discussions

Reply
 
Thread Tools Display Modes
  #11  
Old 07-10-2011, 07:09 AM
kevin.kool kevin.kool is offline
 
Join Date: Nov 2009
Posts: 74
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Got this:

Quote:
Error: 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 '1' at line 1 (1) (id: 1)
Reply With Quote
  #12  
Old 07-10-2011, 07:13 AM
Disasterpiece's Avatar
Disasterpiece Disasterpiece is offline
 
Join Date: Apr 2007
Location: GER
Posts: 765
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Replace line 37 with this:

PHP Code:
    $q "UPDATE ".$tableprefix2."user SET post_thanks_thanked_times = ".$row['post_thanks_thanked_times']." WHERE userid = ".(int)($row['userid']+1); 
Reply With Quote
  #13  
Old 07-10-2011, 07:20 AM
kevin.kool kevin.kool is offline
 
Join Date: Nov 2009
Posts: 74
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

It's Success. But it's look like it doesn't get thanked amount from database1. The thanked amount is from "write" db and being rewrite again with userid+1.
Reply With Quote
  #14  
Old 07-10-2011, 10:52 AM
Disasterpiece's Avatar
Disasterpiece Disasterpiece is offline
 
Join Date: Apr 2007
Location: GER
Posts: 765
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

hum, well it should oO

did you re-check the database credentials?
Reply With Quote
  #15  
Old 07-10-2011, 12:51 PM
kh99 kh99 is offline
 
Join Date: Aug 2009
Location: Maine
Posts: 13,185
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by kevin.kool View Post
It's Success. But it's look like it doesn't get thanked amount from database1. The thanked amount is from "write" db and being rewrite again with userid+1.
[S]If you still have the old table in another database, you could try adding the database to the table names of the first query, like[/S]

Edit: never mind, I hadn't looked at the php file linked above where Disasterpiece had already handled the second database.

BTW, I think this could be done via query something like:
Code:
UPDATE db1.vb_user as old LEFT JOIN db2.vb4_user as new ON (old.userid = new.userid + 1)
SET new.thanked = old.thanked

(But I haven't tested that exact query). That of course assumes that you've already created a "thanked" column in the new db....and that the dbs are on the same server.
Reply With Quote
  #16  
Old 07-10-2011, 10:29 PM
kevin.kool kevin.kool is offline
 
Join Date: Nov 2009
Posts: 74
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by Disasterpiece View Post
hum, well it should oO

did you re-check the database credentials?
Yes, i've recheck the column after each run.

Quote:
Originally Posted by kh99 View Post
[S]If you still have the old table in another database, you could try adding the database to the table names of the first query, like[/S]

Edit: never mind, I hadn't looked at the php file linked above where Disasterpiece had already handled the second database.

BTW, I think this could be done via query something like:
Code:
UPDATE db1.vb_user as old LEFT JOIN db2.vb4_user as new ON (old.userid = new.userid + 1)
SET new.thanked = old.thanked

(But I haven't tested that exact query). That of course assumes that you've already created a "thanked" column in the new db....and that the dbs are on the same server.
Could you rewrite the query with those extractly db name, table name and column name as i listed above?
Reply With Quote
  #17  
Old 07-10-2011, 10:37 PM
kh99 kh99 is offline
 
Join Date: Aug 2009
Location: Maine
Posts: 13,185
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

I think this is it:

Code:
UPDATE vb4forum.user as old LEFT JOIN vb3forum.user as new ON (old.userid = new.userid + 1)
SET new.post_thanks_thanked_times = old.post_thanks_thanked_times

This sets the vb3forum database from the vb4forum database. I think what I posted above assumed that you were going from vb3 to vb4 (at least as far as the table prefixes were concerned). Speaking of which, if you have table prefixes you need to add them.
Reply With Quote
  #18  
Old 07-10-2011, 10:58 PM
kevin.kool kevin.kool is offline
 
Join Date: Nov 2009
Posts: 74
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

I've down from vb4 to vb3, and there is no table prefix on 2 databases, i have full rights to modify them both.

I've just ran the query and there is an error:
Quote:
Error

SQL query:

UPDATE vb4forum.user AS old LEFT JOIN vb3forum.user AS new ON ( old.userid = new.userid +1 ) ;

MySQL said: Documentation
#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 '' at line 1
Reply With Quote
  #19  
Old 07-10-2011, 11:13 PM
kh99 kh99 is offline
 
Join Date: Aug 2009
Location: Maine
Posts: 13,185
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Hmm...well, both lines together are supposed to be all one query and it looks like you just have the first line there.
Reply With Quote
  #20  
Old 07-10-2011, 11:30 PM
kevin.kool kevin.kool is offline
 
Join Date: Nov 2009
Posts: 74
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

yes, i've ran both of them together, but it shows up just 1 line for error.
Reply With Quote
Reply

Thread Tools
Display Modes

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:20 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.04567 seconds
  • Memory Usage 2,270KB
  • Queries Executed 12 (?)
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
  • (3)bbcode_code
  • (1)bbcode_php
  • (5)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
  • (10)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