当前位置: 首页>>代码示例>>PHP>>正文


PHP simple_query函数代码示例

本文整理汇总了PHP中simple_query函数的典型用法代码示例。如果您正苦于以下问题:PHP simple_query函数的具体用法?PHP simple_query怎么用?PHP simple_query使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。


在下文中一共展示了simple_query函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: osmp_getIdByHash

/**
 *
 * Get transaction id by its hash
 *
 * @param   $tablename name of the table to extract last id
 * @return  string
 *
 */
function osmp_getIdByHash($hash)
{
    $hash = mysql_real_escape_string($hash);
    $query = "SELECT `id` from `op_transactions` WHERE `hash`='" . $hash . "'";
    $result = simple_query($query);
    return $result['id'];
}
开发者ID:l1ght13aby,项目名称:Ubilling,代码行数:15,代码来源:index.php

示例2: sendRequest

 private function sendRequest($var = null)
 {
     if (!is_object($this->_sendRequest)) {
         $query = "\r\n        SELECT\r\n          `rbs_requests`.`id`,\r\n          `rbs_requests`.`code`,\r\n          `rbs_requests`.`requestStatus`,\r\n          `rbs_requests`.`requestComment`\r\n        FROM  `rbs_requests` \r\n        JOIN  `rbs_results` ON `rbs_results`.`requestID` = `rbs_requests`.`id`\r\n        WHERE `rbs_results`.`resultStatusCode` = '0'\r\n      ";
         $result = simple_query($query);
         if (!empty($result)) {
             // Если в БД есть запрос со статусом ответа = '0' вносим в
             // переменную запроса `code`, `result` и `resultComment` этого запроса
             $this->_sendRequest = (object) array('code' => $result['code'], 'result' => $result['requestStatus'], 'resultComment' => $result['requestComment']);
             // Запоминаем индекс для дальнейшей связи с результатом
             $this->_requestPK = $result['id'];
         } else {
             // Иначе, генерируем новый xml-файл запроса, подписываем его и делаем
             // запрос в Роскомнадзор на получение новой выгрузки
             $request = $this->generateRequestXml();
             $this->_sendRequest = $this->_soap->sendRequest(array('requestFile' => new SoapVar($request['xml'], XSD_BASE64BINARY, 'xsd:base64Binary'), 'signatureFile' => new SoapVar($request['sig'], XSD_BASE64BINARY, 'xsd:base64Binary'), 'dumpFormatVersion' => '2.0'));
             // Пишем результат в лог и запоминаем индекс для дальнейшей связи с
             // результатом
             $this->_requestPK = $this->logRequest();
         }
     }
     // Если не запрошена конкретная переменная результата запроса - возвращаем
     // все, иначе возвращаем конкретную переменную.
     return is_null($var) ? $this->_sendRequest : @$this->_sendRequest->{$var};
 }
开发者ID:l1ght13aby,项目名称:Ubilling,代码行数:25,代码来源:api.roskomnadzor.php

示例3: ibox_getDateByHash

/**
 *
 * Get transaction datetime by its hash
 *
 * @param   $tablename name of the table to extract last id
 * @return  string
 *
 */
function ibox_getDateByHash($hash)
{
    $hash = mysql_real_escape_string($hash);
    $query = "SELECT `date` from `op_transactions` WHERE `hash`='" . $hash . "'";
    $result = simple_query($query);
    return $result['date'];
}
开发者ID:l1ght13aby,项目名称:Ubilling,代码行数:15,代码来源:index.php

示例4: zb_TicketGetData

/**
 * Returns tickets data by its ID
 * 
 * @param int $ticketid
 * @return array
 */
function zb_TicketGetData($ticketid)
{
    $ticketid = vf($ticketid, 3);
    $query = "SELECT * from `ticketing` WHERE `id`='" . $ticketid . "'";
    $result = simple_query($query);
    return $result;
}
开发者ID:l1ght13aby,项目名称:Ubilling,代码行数:13,代码来源:api.ticketing.php

示例5: zbs_ContrAhentGetData

function zbs_ContrAhentGetData($id)
{
    $id = vf($id);
    $query = "SELECT * from `contrahens` WHERE `id`='" . $id . "'";
    $result = simple_query($query);
    return $result;
}
开发者ID:l1ght13aby,项目名称:Ubilling,代码行数:7,代码来源:api.agents.php

示例6: web_TstatsShow

 function web_TstatsShow()
 {
     $allclasses = zb_DirectionsGetAll();
     $classtraff = array();
     $traffCells = wf_TableCell(__('Traffic classes'), '20%');
     $traffCells .= wf_TableCell(__('Traffic'), '20%');
     $traffCells .= wf_TableCell(__('Traffic classes'));
     $traffRows = wf_TableRow($traffCells, 'row1');
     if (!empty($allclasses)) {
         foreach ($allclasses as $eachclass) {
             $d_name = 'D' . $eachclass['rulenumber'];
             $u_name = 'U' . $eachclass['rulenumber'];
             $query_d = "SELECT SUM(`" . $d_name . "`) FROM `users`";
             $query_u = "SELECT SUM(`" . $u_name . "`) FROM `users`";
             $classdown = simple_query($query_d);
             $classdown = $classdown['SUM(`' . $d_name . '`)'];
             $classup = simple_query($query_u);
             $classup = $classup['SUM(`' . $u_name . '`)'];
             $classtraff[$eachclass['rulename']] = $classdown + $classup;
         }
         if (!empty($classtraff)) {
             $total = max($classtraff);
             foreach ($classtraff as $name => $count) {
                 $traffCells = wf_TableCell($name);
                 $traffCells .= wf_TableCell(stg_convert_size($count), '', '', 'sorttable_customkey="' . $count . '"');
                 $traffCells .= wf_TableCell(web_bar($count, $total), '', '', 'sorttable_customkey="' . $count . '"');
                 $traffRows .= wf_TableRow($traffCells, 'row3');
             }
         }
     }
     $result = wf_TableBody($traffRows, '100%', 0, 'sortable');
     show_window(__('Traffic report'), $result);
 }
开发者ID:l1ght13aby,项目名称:Ubilling,代码行数:33,代码来源:index.php

示例7: show_wahlen

function show_wahlen($row)
{
    extract($row);
    $listen_gueltig = $stimmen_gesamt - $stimmzettel_ungueltig - $listen_ungueltig;
    $listen_summe = $listen_gueltig - $listen_enthaltungen;
    $kandidaten_gueltig = $stimmen_gesamt - $stimmzettel_ungueltig - $kandidaten_ungueltig;
    $kandidaten_summe = $kandidaten_gueltig - $kandidaten_enthaltungen;
    print "\\section{Wahl zum {$wahl_name}}\n";
    if (simple_query("SELECT count(*) FROM liste " . "WHERE wahl = {$wahl_id}") > 1) {
        print "\\subsection*{Listenstimmen}\n";
        // Gesamt-Informationen
        print "Wahlberechtigte: {$wahlberechtigt}, " . "abgegebene Stimmzettel: {$stimmen_gesamt}, " . "Wahlbeteiligung: " . percent($stimmen_gesamt, $wahlberechtigt) . "\\%" . "\n\n" . "ungültige Stimmzettel: {$stimmzettel_ungueltig}, " . "ungültige Stimmen: {$listen_ungueltig} " . "gültige Stimmen: {$listen_gueltig}, " . "\n\n" . "Enthaltungen: {$listen_enthaltungen} " . "\n\n";
        print "\\begin{tabular}{lrrrrl}\n" . "Liste & Stimmen & Anteil & Quote & Sitze & \\\\\\hline\n";
        // Listen-Tabelle
        do_query("SELECT liste.name_kurz, liste.name_lang, " . "anzeige_red as r, anzeige_green as g, " . "anzeige_blue as b, " . "hoechstzahl, sitze, los, " . "sum(liste_urne.stimmen) AS stimmen, " . "{$listen_summe} AS summe " . "FROM liste, urne, liste_urne " . "WHERE liste.id = liste_urne.liste " . "AND urne.id = liste_urne.urne " . "AND urne.status = " . $GLOBALS["ok_status"] . " " . "AND wahl = {$wahl_id} " . "GROUP BY liste.id " . "ORDER by liste.nummer", show_listen);
        print "\\hline\\end{tabular}\n\n";
        $num_los = simple_query("SELECT los FROM liste " . "WHERE wahl = {$wahl_id} " . "AND los > 0");
        if ($num_los > 0) {
            print "(+1): ggf. +1 von {$num_los} Restsitzen " . "per Los\n\n";
        }
    }
    // Kandidaten
    print "\\subsection*{Kandidierendenstimmen}\n";
    // Gesamt-Daten
    print "Wahlberechtigte: {$wahlberechtigt}, " . "abgegebene Stimmzettel: {$stimmen_gesamt}, " . "Wahlbeteiligung: " . percent($stimmen_gesamt, $wahlberechtigt) . "\\%" . "\n\n" . "ungültige Stimmzettel: {$stimmzettel_ungueltig}, " . "ungültige Stimmen: {$kandidaten_ungueltig}, " . "gültig: {$kandidaten_gueltig} " . "\n\n";
    if ($max_stimmen_wert == 1) {
        print "Enthaltungen: {$kandidaten_enthaltungen} " . "\n\n";
    }
    // Kandidaten
    do_query("SELECT liste.id AS liste_id, " . "liste.name_kurz AS liste_name_kurz, " . "liste.name_lang AS liste_name_lang, " . "anzeige_red AS r, " . "anzeige_green AS g, " . "anzeige_blue AS b, " . "kandidat.typ AS kandidat_typ, " . "kandidat.status AS status, " . "kandidat.vorname AS kandidat_vorname, " . "kandidat.nachname AS kandidat_nachname, " . "sum(kandidat_urne.stimmen) AS stimmen " . "FROM liste, kandidat, urne, kandidat_urne " . "WHERE kandidat.id = kandidat_urne.kandidat " . "AND urne.id = kandidat_urne.urne " . "AND liste.id = kandidat.liste " . "AND urne.status = " . $GLOBALS["ok_status"] . " " . "AND liste.wahl = {$wahl_id} " . "GROUP BY kandidat.id " . "ORDER BY liste.nummer, liste.id, status, stimmen DESC, " . "kandidat.listenplatz", show_kandidaten);
    if ($num_los != 0) {
        print "\\footnotemark{(*)} {$num_los} Restsitze werden per " . "Los auf die gekennzeichneten Listen verteilt.\n\n";
    }
}
开发者ID:asta-kit,项目名称:friwahl-legacy,代码行数:34,代码来源:ergebnisse.php

示例8: ds_GetCashSumm

 function ds_GetCashSumm($login, $day)
 {
     global $tablename;
     $login = vf($login);
     $day = vf($day);
     $query = "SELECT SUM(`cash`) from `" . $tablename . "` WHERE `login`='" . $login . "'  AND `day`='" . $day . "'";
     $summ = simple_query($query);
     return $summ['SUM(`cash`)'];
 }
开发者ID:l1ght13aby,项目名称:Ubilling,代码行数:9,代码来源:index.php

示例9: sber_getTransactionDate

function sber_getTransactionDate($hash)
{
    $hash = mysql_real_escape_string($hash);
    $query = "SELECT `date` from `op_transactions` WHERE `hash`='" . $hash . "'";
    $data = simple_query($query);
    $rawDate = $data['date'];
    $timestamp = strtotime($rawDate);
    $result = date("Y-m-d\\TH:i:s", $timestamp);
    return $result;
}
开发者ID:l1ght13aby,项目名称:Ubilling,代码行数:10,代码来源:index.php

示例10: zbs_CatvGetAssociatedUser

 function zbs_CatvGetAssociatedUser($login)
 {
     $query = "SELECT * from `catv_users` WHERE `inetlink`='" . $login . "'";
     $userdata = simple_query($query);
     if (!empty($userdata)) {
         return $userdata;
     } else {
         return false;
     }
 }
开发者ID:l1ght13aby,项目名称:Ubilling,代码行数:10,代码来源:index.php

示例11: pltz_GetFreeId

/**
 * Returns next free transaction ID
 * 
 * @return int
 */
function pltz_GetFreeId()
{
    $query = "SELECT `id` from `op_transactions` ORDER BY `id` DESC LIMIT 1";
    $result = simple_query($query);
    if (!empty($result)) {
        $result = $result['id'] + 1;
    } else {
        $result = 1;
    }
    return $result;
}
开发者ID:l1ght13aby,项目名称:Ubilling,代码行数:16,代码来源:index.php

示例12: nvp_CheckTransaction

function nvp_CheckTransaction($hash)
{
    $hash = mysql_real_escape_string($hash);
    $query = "SELECT `id` from `op_transactions` WHERE `hash`='" . $hash . "'";
    $data = simple_query($query);
    if (!empty($data)) {
        return $data['id'];
    } else {
        return false;
    }
}
开发者ID:l1ght13aby,项目名称:Ubilling,代码行数:11,代码来源:index.php

示例13: ep_GetTransactionTime

function ep_GetTransactionTime($id)
{
    $id = vf($id, 3);
    $query = "SELECT `date` from `op_transactions` WHERE `id`='" . $id . "'";
    $data = simple_query($query);
    if (!empty($data)) {
        return $data['date'];
    } else {
        return false;
    }
}
开发者ID:l1ght13aby,项目名称:Ubilling,代码行数:11,代码来源:index.php

示例14: ra_NasGetTemplate

function ra_NasGetTemplate($nasid)
{
    $nasid = vf($nasid, 3);
    $query = "SELECT `template` from `nastemplates` WHERE `nasid`='" . $nasid . "'";
    $result = simple_query($query);
    if (!empty($result)) {
        $result = $result['template'];
    } else {
        $result = '';
    }
    return $result;
}
开发者ID:l1ght13aby,项目名称:Ubilling,代码行数:12,代码来源:api.radius.php

示例15: zb_StorageGet

/**
 * Returns value or empty data from ubstorage if key not exists
 * 
 * @param string $key
 * @return string
 */
function zb_StorageGet($key)
{
    $key = mysql_real_escape_string($key);
    $query = "SELECT `value` from `ubstorage` WHERE `key`='" . $key . "'";
    $fetchdata = simple_query($query);
    if (!empty($fetchdata)) {
        $result = $fetchdata['value'];
    } else {
        $result = '';
    }
    return $result;
}
开发者ID:l1ght13aby,项目名称:Ubilling,代码行数:18,代码来源:api.ubstorage.php


注:本文中的simple_query函数示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。