Beispiel #1
0
function _getUserID($username, $pswd)
{
    $connection = __connectDB();
    __selectDB($connection);
    $sql = "select id from " . TABLE_USERS . " where username='******' and password = '******';";
    echo $sql;
    $results = mysql_query($sql, $connection);
    $row = mysql_fetch_assoc($results);
    $datum = $row['id'];
    __disconnectDB($connection);
    return $datum;
}
Beispiel #2
0
function _createRandomString($length)
{
    while (true) {
        $str = createAString($length);
        $connection = __connectDB();
        __selectDB($connection);
        $sql = "select access_key from purchase where access_key='{$str}';";
        $results = mysql_query($sql, $connection);
        $row = mysql_fetch_assoc($results);
        $datum = $row['access_key'];
        __disconnectDB($connection);
        if ($datum == "") {
            break;
        }
        return $datum;
    }
    return $str;
}
function _getDeliveredCouponCodeList()
{
    $connection = __connectDB();
    __selectDB($connection);
    $sql = "SELECT couponCode, custName, custEmail, dateDelivered FROM cpn_couponcodes WHERE STATUS =2 ORDER BY dateDelivered DESC LIMIT 0 , 24;";
    $results = mysql_query($sql, $connection);
    __disconnectDB($connection);
    return $results;
}