Example #1
0
function add_trans($uuid, $amount, $type, $reason)
{
    $reason_no_us = str_replace("_", " ", $reason);
    get_mysql()->query("insert into transactions (uuid, amount, type, reason) values ('{$uuid}', '{$amount}', '{$type}', '{$reason_no_us}')");
}
Example #2
0
<?php

require 'helpers.php';
get_mysql();
$username_to_test = ':username';
/*** prepare the SQL SELECT statement ***/
// http://goo.gl/uPWYV
$stmt = $dbh->prepare("SELECT username, password FROM users WHERE username = :username");
$stmt->bindParam(':username', $username_to_test, PDO::PARAM_STR, 64);
$stmt->execute();
$red = $stmt->fetchAll();
echo '<pre>';
echo print_r($red);
echo '</pre>';
Example #3
0
function register($username, $password)
{
    $password = hash("sha256", $password);
    get_mysql()->query("insert into users (username, password) values ('{$username}', '{$password}')");
}
 static function downUp($name)
 {
     $int = $name->downloads + 1;
     get_mysql()->query("update sounds set downloads='{$int}' where name='{$name->name}'");
     return $int;
 }