1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

SQL query help

Discussion in 'Other Languages' started by ruicosta, Jul 4, 2013.

  1. ruicosta

    ruicosta Regular Member

    Joined:
    Nov 23, 2009
    Messages:
    209
    Likes Received:
    21
    Location:
    Croatia
    I need to transfer data from karma mod in phpbb to karma in smf.
    Phpbb has a table phpbb_karma which is basically a karma log. Important fields we need to focus on are user_id (user which got the karma) and karma_action (positive or negative karma, shown as + or -).
    I would need a query to count all the pluses and minuses and then copy the given results for each unique user_id into smf_members table under appropriate id_member (user_id field in smf) and karma_good (all the pluses) and karma_bad (all the minuses).
    I think it can be done but I am not sql expert.
     
  2. innozemec

    innozemec Jr. VIP Jr. VIP

    Joined:
    Aug 19, 2011
    Messages:
    5,288
    Likes Received:
    1,799
    Location:
    www.Indexification.com
    Home Page:
    it should be like this..

    INSERT into karma_good SELECT user_id from phpbb_karma where karma_action='+';
    INSERT into karma_bad SELECT user_id from phpbb_karma where karma_action='-';
     
  3. small buddy

    small buddy Regular Member

    Joined:
    May 21, 2013
    Messages:
    254
    Likes Received:
    178
  4. shaadisankalp

    shaadisankalp Newbie

    Joined:
    Sep 13, 2013
    Messages:
    11
    Likes Received:
    0
    SQL is stand for the structure query language. This language is very interesting language. SQL is special type programming language. SQL is used the insert data form the data base and Deleted the Data from the Data Base. Sql can view the data base.