[Query] Add Silk To all Registered users

02/27/2012 11:22 Dr.Abdelfattah#1
Hello ,

(resume to queries threads) Just a very simple query to add amount of silk to all registered users

PHP Code:
/***********Wrote by Dr.Abdelfattah***********/  
USE SRO_VT_ACCOUNT;
GO
INSERT INTO SK_SILK 
(JID,
silk_own,
silk_gift,
silk_point
SELECT JID,
'0',
'0',
'0'
FROM TB_User 
WHERE not exists 
(select from SK_Silk 
WHERE SK_SILK
.JID TB_User.JID);
UPDATE SK_Silk SET silk_own=silk_own+10
/***********Wrote by Dr.Abdelfattah***********/ 
at SRO_VT_ACCOUNT change to your account db name if you change it,
at silk_own=silk_own+10 change 10 to the silk value(amount) you need to add to all registered users .

Have Fun .
02/28/2012 14:37 JungleRules#2
Thanks Abdelfattah
02/28/2012 15:15 Dr.Abdelfattah#3
#Reported to spamming/flaming out again
and watch out my query again it's completely different from your query now and i can't change it anymore, it's the best form .

your query

INSERT INTO SK_SILK
(JID)
SELECT JID
FROM TB_User
WHERE not exists (select * from SK_Silk
WHERE SK_SILK.JID = TB_User.JID);

mine

INSERT INTO SK_SILK
(JID,
silk_own,
silk_gift,
silk_point)
SELECT JID,
'0',
'0',
'0'
FROM TB_User
WHERE not exists (select * from SK_Silk
WHERE SK_SILK.JID = TB_User.JID);
UPDATE SK_Silk SET silk_own=silk_own+10

values function is also removed, at last no more replay i will just report that spam
02/28/2012 16:18 ermvrs#4
thanks my friend :D also everyone can use it too for give silks to all users.

update sk_silk set silk_own = silk amount where jid>0
03/10/2012 14:26 firat0909#5
Thank you very much this is very useful.