Online Time point..
#21

 

 
mysql --user=usernamehere --password=passwordhere -e "UPDATE newproject_auth.bg_user SET cash = cash + 5 WHERE user_code in (SELECT a_portal_index FROM newproject_auth.t_users WHERE a_zone_num >= 0"
 

 

try this one

#22


 
mysql --user=usernamehere --password=passwordhere -e "UPDATE newproject_auth.bg_user SET cash = cash + 5 WHERE user_code in (SELECT a_portal_index FROM newproject_auth.t_users WHERE a_zone_num >= 0"
 

try this one

 

 

I got this error now

ERROR 1064 (42000) at line 1: 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
#23

then its probably without the " " 

or maybe with single quotes

 

I never tried this method before

#24

Tride with single and without any symbol...but its same no work :/

Its not possible to make it work..

#25
2
#26

<!DOCTYPE html>

<html>

<head>

<title>Credit ToXiC L33T</title>

<meta http-equiv="Content-Type" content="text/html; charset=utf-8">

<script type="text/javascript">

 

<?PHP

error_reporting(E_ALL);

ini_set(display_errors, 1);

 

if ($_SERVER[REMOTE_ADDR] == "127.0.0.1"){ ?>

 

function Timer(id, minLimit, callback){

var thisTimer = this;

this.limit = minLimit * 60;

this.callback = callback;

this.timer = 0;

this.addEvent(window, load, function(){

thisTimer.el = document.getElementById(id);

thisTimer.txt = thisTimer.el.firstChild;

thisTimer.intv = setInterval(function(){thisTimer.intvFunc();}, 1000);

});

}

 

Timer.prototype = {

 

intvFunc: function(){

this.txt.nodeValue = this.formatTime(++this.timer);

if(this.timer === this.limit){

clearInterval(this.intv);

this.callback.call(this);

}

},

 

formatNum: function(n){

return n < 10? 0 + n : n;

},

 

formatTime: function (n, m, s){

s = n % 60;

m = (n - s) / 60;

return [this.formatNum(m), :, this.formatNum(s)].join();

},

 

addEvent: (function(){return window.addEventListener? function(el, ev, f){

el.addEventListener(ev, f, false);

}:window.attachEvent? function(el, ev, f){

el.attachEvent(on + ev, f);

}:function(){return;};

})()

};

 

// Usage: new Timer(id_of_counting_element, #_of_mins, callback_function(){});

new Timer(timer1, 5, function(){this.el.parentNode.style.color = red});

</script>

</head>

<body bgcolor="#C7C7C9">

<?php

// Mysql IP

$dbset["host"] = 127.0.0.1; // dns or ip

// Mysql Login

$dbset["username"] = root; // Mysql username

$dbset["password"] = password; // Mysql password

// Mysql Databases

$dbset["lc_auth"] = newproject_db_auth; // auth database

$dbset["lc_authORdb"] = newproject_db_user; // user database

 

    try {

    $conn234 = new PDO(mysql:host=.$dbset["host"]., $dbset["username"], $dbset["password"]);

    } catch(PDOException $e) {

    echo ERROR: . $e->getMessage();

    }

    

    echo "<b><font size=6>Online Time by ToXiC L33T</font></b><br /><font color=red>KEEP THIS FILE HIDDEN, ONLY RUN ON ROOT</font><br/>";

 

$query = sprintf("SELECT a_portal_index from %s.t_users WHERE a_zone_num > -1", $dbset["lc_authORdb"] );

$dbh = $conn234->prepare( $query );

$dbh->execute();

$query1 = sprintf("SELECT count(a_index) from %s.t_users WHERE a_zone_num > -1", $dbset["lc_authORdb"] );

$dbh1 = $conn234->prepare( $query1 );

$dbh1->execute();

    $r1a = $dbh1->fetch();

    $Effected = $r1a[0];

    

    while( $r1 = $dbh->fetch() ){

$UID = $r1[a_portal_index];

$query2 = sprintf("UPDATE %s.bg_user SET cash = cash + 3 WHERE user_code = ". $UID ."", $dbset["lc_auth"] );

$dbh2 = $conn234->prepare( $query2 );

$dbh2->execute();

}

?>

<hr/><br/>

Effected Accounts: <font color=green><?PHP print $Effected; ?></font>

<div>Next OLT in 5 minutes: <font color=orange><span id="timer1">00:00</span></font></div>

<meta http-equiv="refresh" content="300; url=onlinetime.php">

</body>

 

<?php 

} else {

echo "</head><body>Please run this from 127.0.0.1 on your root server</body></html>";

}

?>
#27


#!/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

 

 

#28

Thanks but i solved my problem.I dont know its work,i have other...

Close topic please.

#29

Hi.

As you got your answer, and your problem is solved, I am gonna move that topic to Solved section and mark it as solved.

 

Thanks,

 

-LCKB Staff



Forum Jump:


Users browsing this thread: 2 Guest(s)