function selectSomeSingle($page,$fileds,$field,$id){ $connector = new DbConnector(); $query = 'SELECT '.$fields.' FROM '.$page.' WHERE '.$field.'='.$id; $sqlrs=$connector->query($get_data); while ($row=$connector->fetchArray($sqlrs)) { $data['id'] = $row['id']; }; return $data; }
$faucetcurrency = $db->res['value']; $db->queryres("select * from tbl_config where header='pusername'"); $pusername = $db->res['value']; $db->queryres("select * from tbl_config where header='papiname'"); $papiname = $db->res['value']; $db->queryres("select * from tbl_config where header='ppassword'"); $ppassword = $db->res['value']; $db->queryres("select * from tbl_config where header='requestcount'"); $requestcount = $db->res['value']; $api = new AsmoneyAPI($pusername, $papiname, $ppassword); //Change to mili bitcoin because asmoney get currencies based on milicoin $db->query("select * from tbl_withdrawal where status=0"); $btcaddresses = array(); $btcamounts = array(); $withdrawalid = array(); while ($res = $db->fetchArray()) { $currency = $faucetcurrency; if ($res['type'] == 0) { $db2->queryres("select * from tbl_user where user_id='" . $res['user_id'] . "'"); $ausername = $db2->res['ausername']; $amount = ChangetoMili($res['amount'], $currency); $r = $api->Transfer($ausername, $amount, $currency, 'Withdrawal'); // Payment memo echo $r['result']; if ($r['result'] == APIerror::OK) { $batchno = $r['value']; $db2->query("update tbl_withdrawal set status=1,reccode='{$batchno}' where withdrawal_id='" . $res['withdrawal_id'] . "'"); echo "Withdrawal has been proceessed with bactch number " . $batchno . "<br>"; } else { if ($r['result'] == APIerror::InvalidUser) { echo "Invalid User"; }
<?php /** * @author asmalindi * @copyright 2011 */ // Get the PHP file containing the DbConnector class require_once 'DbConnector.php'; // Create an instance of DbConnector $connector = new DbConnector(); // Use the query function of DbConnector to run a database query $result = $connector->query('SELECT firstname FROM customers'); // Get the result $row = $connector->fetchArray($result); // Show it to the user echo $row['firstname'];