The Arcive of Official vBulletin Modifications Site.It is not a VB3 engine, just a parsed copy! |
|
#1
|
|||
|
|||
Doing some math in mysql and copy it to another table
Hi folks,
I have a problem in reading out the users postcount, multiply this with a given value and add it to another table. Here is the desciption of the things I need to do: https://vborg.vbsupport.ru/showpost....&postcount=323 - read each user info - count number of posts per user - multiply the number of posts times 25 ( if this is the amount of money you are giving ) - read the current amount of money at the bank account of each user - add these numbers - store the new result in the bank account The big problem is that the structure of the two tables is not identical. After some trying I realised that I didn't need to copy the data into another table as user table has also a 'money' column. What I am now trying to do is reading out people's post count and multiply this with e.g. 25 and then write this value into the 'money' column of the same table. However as I am not as good in mysql as you guys, I wasn't able to do that yet. :/ I hope someone could shed some light on this problem =) I hope someone could post a query which does that little trick TIA, -d |
#2
|
|||
|
|||
I already found the solution to my problem... it's quite simple. Do following query in phpadmin:
UPDATE user set money = posts * 25; This sets the available petz money to be 25times the post count. -d |
Thread Tools | |
Display Modes | |
|
|
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
More Information | |
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|