01-28-2014, 10:22 PM
#!/bin/bash
#
host=127.0.0.1
user=root
pass=YOURPASSWORD
auth_db=YOURAUTHBD
user_db=YOURUSERDB
cash=YOURAMOUNT
select=`mysql -D $user_db -h $host --user=$user --password=$pass --skip-column-names -e "SELECT a_portal_index FROM t_users WHERE a_zone_num > -1"`
for online in ${select[@]}
do
setcash=`mysql -D $auth_db -h $host --user=$user --password=$pass --skip-column-names -e "UPDATE bg_user SET cash = cash +$cash WHERE user_code = $online"`
done
safe this in a script, for example called cash.sh and run it in your terminal command ./cash.sh
to run it automatically set a cronjob every 5 minutes, one hour or something else

