• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

PHP mq函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



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

示例1: booklog

function booklog($book, $type, $message)
{
    global $abltype;
    if (!isset($abltype[$type])) {
        echo "ERROR: booklog called with bad type:{$type} ({$message})\n";
    } else {
        mq("INSERT INTO booklog SET book='" . intval($book) . "', type='" . intval($type) . "', message='" . addslashes($message) . "';");
    }
}
开发者ID:vincib,项目名称:domainepublic,代码行数:9,代码来源:bookfuncs.php


示例2: chdir

<?php

chdir('../../../../');
require 'db.php';
$user_id = mysql_real_escape_string($_POST['user_id']);
$points = floatval(mysql_result(mq(totalMarks("WHERE user_id = {$user_id}")), 0));
//echo $points; exit;
$sql = "select user_code from users where user_id = " . $user_id;
$result = mysql_query($sql);
$row = mysql_fetch_assoc($result);
$points += @reset(header_store_points(array("user_code" => $row['user_code'])));
echo $points;
开发者ID:naftolir,项目名称:CthMobile,代码行数:12,代码来源:getPoints.php


示例3: addslashes

<?php

require "../system/incl.php";
if (isset($_GET['del'])) {
    $del = addslashes($_GET['del']);
    $q = "SELECT * FROM `group2category` WHERE `id_category`='{$del}'";
    $res = mq($q);
    if (mysql_num_rows($res) > 0) {
        $error = array("Невозможно удалить выбранную категорию, так как существуют группы, связанные с ней.");
        $smarty->assign("errors", $error);
    } else {
        $q = "DELETE FROM `category` WHERE `id`='{$del}'";
        mq($q);
        $smarty->assign("message", "Удалено!");
    }
}
$q = "SELECT * FROM `category` ORDER BY `weight`, `name_ru`";
$res = mq($q);
$data = array();
if (mysql_num_rows($res) > 0) {
    while ($info = mysql_fetch_array($res)) {
        $data[] = $info;
    }
}
if (count($data) > 0) {
    $smarty->assign("data", $data);
} else {
    $smarty->assign("nodata", true);
}
$smarty->display("adm_category_list.tpl");
开发者ID:roman-reva,项目名称:iec,代码行数:30,代码来源:category_list.php


示例4: array

        }
    }
    // Now we store the attributes :
    $attr["fnac"] = array("url" => $book[0]);
    if ($isbn) {
        $attr["isbn"] = $isbn;
    }
    if ($image) {
        $attr["fnac"]["image"] = $image;
        $store = md5($image) . ".jpg";
        curl_simple_get($image, IMAGE_ROOT . "/" . $store);
        if (@filesize(IMAGE_ROOT . "/" . $store)) {
            $attr["fnac"]["imageurl"] = $store;
        }
    }
    if ($isbn) {
        $attr["isbn"] = $isbn;
    }
    if ($already) {
        $sql = "";
        if (!$already["authors"]) {
            $sql .= " , authors='" . addslashes($author) . "' ";
        }
        mq("UPDATE books SET collection=6, title='" . addslashes($book[1]) . "', isbn='{$isbn}', attribs='" . addslashes(json_encode($attr)) . "' {$sql} WHERE id=" . $already["id"] . ";");
        echo "Update book " . $already["id"] . "\n";
    } else {
        mq("INSERT INTO books SET datecreated=NOW(), collection=6, title='" . addslashes($book[1]) . "', authors='" . addslashes($author) . "', isbn='{$isbn}', attribs='" . addslashes(json_encode($attr)) . "';");
        echo "Created book " . mysql_insert_id() . "\n";
    }
}
// for each book
开发者ID:vincib,项目名称:domainepublic,代码行数:31,代码来源:scrap-immateriel.php


示例5: array

            $attr["formats"][$aformat[$action]] = array("name" => $id, "size" => filesize(UPLOAD_ROOT . "/" . $id), "othercollection" => $oc);
            mq("UPDATE books SET dateuploaded=NOW(), downloadable=1, attribs='" . addslashes(json_encode($attr)) . "' WHERE id=" . $book["id"] . ";");
            $_REQUEST["msg"] = _("The upload has been validated");
            break;
        case 99:
            mq("UPDATE uploads SET datemoderated=NOW(), status=" . $action . " WHERE id=" . $id . ";");
            $_REQUEST["msg"] = _("The upload has been trashed");
            break;
    }
}
require_once "head.php";
require_once "menu.php";
require "messagebox.php";
$offset = 0;
$count = 100;
$r = mq("SELECT uploads.*, books.title, books.authors FROM uploads, books WHERE uploads.status=0 AND books.id=uploads.book_id ORDER BY uploads.id LIMIT {$offset},{$count};");
echo mysql_error();
?>

<div class="container-fluid main"> 

<div class="row">
<div class="span12">
  <div style="float: right; padding: 10px;">
  <a href="https://fr.wikipedia.org/wiki/Domaine_public_%28propri%C3%A9t%C3%A9_intellectuelle%29"><img src="/assets/img/pd.png"/></a>
</div>

    <h1><?php 
__("Uploaded files moderation");
?>
</h1>
开发者ID:vincib,项目名称:domainepublic,代码行数:31,代码来源:moderate.php


示例6: mq

<?php

require_once "lib/ssl.php";
function mq($x)
{
    if (get_magic_quotes_gpc()) {
        return stripslashes($x);
    } else {
        return $x;
    }
}
$keysize = mq($_REQUEST['keysize']);
$passphrase = mq($_REQUEST['passphrase']);
?>
<html>
<head>
<title>Public Key Forge</title>
</head>
<body>
<?php 
if ($keysize && is_numeric($keysize)) {
    $ssl = new ssl();
    $privkey = $ssl->make_privkey($keysize, $passphrase);
    $pubkey = $ssl->privkey_to_pubkey($privkey, $passphrase);
    $id = $ssl->pubkey_id($pubkey);
    echo "ID: {$id}<br>\n";
    echo "<pre>\n{$pubkey}</pre>\n";
    echo "<pre>\n{$privkey}</pre>\n";
}
if (!$keysize || !is_numeric($keysize)) {
    $keysize = 512;
开发者ID:billstclair,项目名称:trubanc,代码行数:31,代码来源:makekey.php


示例7: ChangeDisplayName

function ChangeDisplayName($uid = 0, $dname = '')
{
    global $handler;
    $dname = mq($dname);
    count_mysql_query("UPDATE uo_chat_database SET displayname={$dname} WHERE uid={$uid}", $handler, "helpers.php: ChangeDisplayName() 1/1");
}
开发者ID:TinoDidriksen,项目名称:pjj-chats,代码行数:6,代码来源:helpers.php


示例8: rand

                $cat2 = rand(0, count($c) - 1);
            } while (in_array($cat2, $cat));
            $cat[] = $cat2;
        }
        if (count($c) > 2) {
            do {
                $cat2 = rand(0, count($c) - 1);
            } while (in_array($cat2, $cat));
            $cat[] = $cat2;
        }
        foreach ($cat as $cc) {
            $catalog[] = $c[$cc];
        }
    }
}
$r = mq("SELECT books.*, uploads.id AS uid FROM books LEFT JOIN uploads ON uploads.book_id=books.id AND uploads.status=0 WHERE 1 {$sql} ORDER BY downloadable DESC, title ASC LIMIT {$offset},{$count};");
echo mysql_error();
// TODO : start by a list of (bigger cover) "latest uploaded books" (+ their upload date)
?>

<div class="container-fluid main"> 

<div class="row">
<div class="span12">

<?php 
if (count($catalog)) {
    ?>
      <p><?php 
    __("Among the latest books we received, we recommend:");
    ?>
开发者ID:vincib,项目名称:domainepublic,代码行数:31,代码来源:booklist.php


示例9: __

 <input type="button" name="cancel" value="<?php 
        __("Cancel");
        ?>
" onclick="document.location='/accounts.php'" />
</div>
</form>
<?php 
        break;
        // ACTION EDIT / CREATE
    // ACTION EDIT / CREATE
    case "delete":
        break;
        // ACTION DELETE
    // ACTION DELETE
    default:
        $r = mq("SELECT * FROM users ORDER BY login;");
        ?>


<p>
   <a class="btn" href="/accounts.php?action=create"><?php 
        __("Create new account");
        ?>
</a>
</p>
<table class="matable">
    <tr>
  <th><?php 
        __("Edit");
        ?>
</th>
开发者ID:vincib,项目名称:domainepublic,代码行数:31,代码来源:accounts.php


示例10: feedback2Action

 function feedback2Action()
 {
     global $view, $params;
     // Check the campaign
     if (!isset($params[0])) {
         not_found();
     }
     $slug = addslashes(trim($params[0]));
     $view["campaign"] = $this->_getCampaign($slug);
     // Exit in case of error
     // Check the call :
     if (!isset($params[1])) {
         not_found();
     }
     $view["callid"] = $cid = intval($params[1]);
     $call = mqone("SELECT * FROM calls WHERE id='" . $view["callid"] . "';");
     $callee = mqone("SELECT * FROM lists WHERE phone='(" . $call["callee"] . ")';");
     if ($call["feedback"]) {
         $view["error"] = _("A feedback has already been given for that call, sorry");
         $this->call2Action();
         exit;
     }
     mq("UPDATE calls SET feedback='" . addslashes($_REQUEST["feedback"]) . "' WHERE id='" . $view["callid"] . "';");
     mq("UPDATE lists SET callcount=callcount+1 WHERE id='" . $callee["id"] . "');");
     $view["message"] = _("Your feedback has been sent to us, thanks for your participation! CALLID:");
     render("campaigncall2");
 }
开发者ID:ludovictant,项目名称:piphone,代码行数:27,代码来源:campaignController.php


示例11: __

 <input type="button" name="cancel" value="<?php 
        __("Cancel");
        ?>
" onclick="document.location='/collections.php'" />
</div>
</form>
<?php 
        break;
        // ACTION EDIT / CREATE
    // ACTION EDIT / CREATE
    case "delete":
        break;
        // ACTION DELETE
    // ACTION DELETE
    default:
        $r = mq("SELECT c.id,c.name,count(b.id) AS books FROM collections c LEFT JOIN books b ON b.collection=c.id GROUP BY c.id ORDER BY c.name;");
        ?>

<p>
   <a class="btn" href="/collections.php?action=create"><?php 
        __("Create new collection");
        ?>
</a>
</p>
<table class="matable">
    <tr>
  <th><?php 
        __("Edit");
        ?>
</th>
    <th><?php 
开发者ID:vincib,项目名称:domainepublic,代码行数:31,代码来源:collections.php


示例12: getCategoryInfoById

function getCategoryInfoById($id)
{
    $q = "SELECT * FROM `category` WHERE id={$id}";
    $info = mysql_fetch_array(mq($q));
    return localizeObject($info);
}
开发者ID:roman-reva,项目名称:iec,代码行数:6,代码来源:dao.php


示例13: addslashes

}
if (isset($_GET['id'])) {
    $id = addslashes($_GET['id']);
    $q = "SELECT * FROM `{$table}` WHERE id={$id}";
    $res = mq($q);
    $data = mysql_fetch_array($res);
    $data['filesize'] = (int) (filesize("../" . $data['file']) / 1024 + 0.5);
    if (isset($_GET['delfile'])) {
        $q = "UPDATE `{$table}` SET `file`='', `filename`='' WHERE `id`='{$id}'";
        mq($q);
        if (is_file("../" . $data['file'])) {
            unlink("../" . $data['file']);
        }
        unset($data['file']);
        $smarty->assign("message", "Файловое вложение удалено!");
    }
    $smarty->assign("data", $data);
    $edit = true;
}
$res = mq("SELECT * FROM `page_type` ORDER BY `name_ru`");
$page_type = array();
while ($info = mysql_fetch_array($res)) {
    $page_type[] = $info;
}
$smarty->assign("page_type", $page_type);
if ($edit) {
    $smarty->assign("page_title", "Редактировать материал");
} else {
    $smarty->assign("page_title", "Новый материал");
}
$smarty->display("adm_page_edit.tpl");
开发者ID:roman-reva,项目名称:iec,代码行数:31,代码来源:page_edit.php


示例14: chdir

<?php

chdir('../../../');
require 'db.php';
$file = $_FILES['image'];
if (is_uploaded_file($file['tmp_name'])) {
    $count = 0;
    do {
        if ($count++ > 100000) {
            echo 'Could not get ID.';
            exit;
        }
        $id = mysql_result(mysql_query('SELECT FLOOR(RAND() * 4294967295)'), 0);
    } while (mysql_result(mysql_query("SELECT COUNT(*) FROM files WHERE file_id = {$id}"), 0) != 0);
    mq("INSERT INTO files (file_id, file_name, file_content_type, file_data) VALUES ({$id}, " . ms($file['name']) . ', ' . ms(mime_content_type($file['tmp_name'])) . ', ' . ms(file_get_contents($file['tmp_name'])) . ')');
    echo $id;
} else {
    echo 0;
}
开发者ID:naftolir,项目名称:CthMobile,代码行数:19,代码来源:setPhoto.php


示例15: ChangePrefs

function ChangePrefs($username, $password, $newpref, $nmail, $chatpath, $icq, $aim, $ym, $msn, $site, $skype = '', $lastfm = '', $flickr = '', $dname = '', $facebook = '', $gplus = '', $steam = '')
{
    global $handler;
    if (VerifyLogin($username, $password, $chatpath)) {
        $newpref = mq($newpref);
        $nmail = mq($nmail);
        $icq = intval($icq);
        $aim = mq($aim);
        $ym = mq($ym);
        $msn = mq($msn);
        $site = mq($site);
        $skype = mq($skype);
        $lastfm = mq($lastfm);
        $flickr = mq($flickr);
        $dname = mq($dname);
        $facebook = mq($facebook);
        $gplus = mq($gplus);
        $steam = mq($steam);
        @count_mysql_query("UPDATE uo_chat_database SET prefs={$newpref}, email={$nmail}, icq={$icq}, aim={$aim},\n\t\t\tym={$ym}, msn={$msn}, site={$site}, skype={$skype}, lastfm={$lastfm}, flickr={$flickr}, displayname={$dname},\n\t\t\tfacebook={$facebook}, gplus={$gplus}, steam={$steam}\n\t\t\tWHERE chat='{$chatpath}' AND username='{$username}' AND dtime IS NULL", $handler);
        echo "<p>Preferences for '{$username}' set to {$newpref}, {$nmail}, {$icq}, {$aim}, {$ym}, {$msn}, {$skype}, {$lastfm}, {$flickr}, {$facebook}, {$gplus}, {$steam}, {$dname}.<br>";
        return 1;
    }
    return 0;
}
开发者ID:xcommunicato,项目名称:pjj-chats,代码行数:24,代码来源:tome_of_power.php


示例16: mep_step3

function mep_step3($mep, $campaign)
{
    global $picdir;
    // Now we have all information we could have on that MEP, let's download the picture (if needed) and put the metadata in the
    if ($mep["picture"]) {
        $pd = md5($mep["picture"]);
        if (!file_exists($picdir . $pd . ".jpg")) {
            copy($mep["picture"], $picdir . $pd . ".jpg");
        }
        if (!file_exists($picdir . $pd . ".jpg")) {
            unset($mep["picture"]);
        } else {
            $mep["picurl"] = $pd . ".jpg";
        }
    }
    // set stb or bxl for the campaign location :
    $phone = str_replace("+", "00", $mep["bxl"]);
    echo "\n\n######################################## \nMEP: \n";
    print_r($mep);
    echo "phone: {$phone}\n";
    mq("INSERT INTO lists SET \n    campaign='{$campaign}', \n    name='" . addslashes($mep["name"]) . "', \n    meta='" . addslashes(serialize($mep)) . "', \n    callcount=0, enabled=1, \n    country='" . addslashes($mep["country"]) . "', \n    phone='" . addslashes($phone) . "'\n    ;");
}
开发者ID:ludovictant,项目名称:piphone,代码行数:22,代码来源:getliste.php


示例17: mqone

<?php

require_once "common.php";
$error = "";
if (isset($_POST["login"]) && isset($_POST["password"])) {
    $me = false;
    $me = mqone("SELECT * FROM users WHERE `login`='" . addslashes($_POST["login"]) . "';");
    if ($me) {
        print_r($me);
        if ($me["pass"] != crypt($_POST["password"], $me["pass"])) {
            $error = _("Incorrect username or password");
        } else {
            mq("UPDATE users SET lastlogin=NOW() WHERE id=" . $me["id"] . ";");
            $_SESSION["id"] = $me["id"];
            $_SESSION["me"] = $me;
            session_write_close();
            header("Location: /?msg=" . _("Welcome"));
            exit;
        }
    } else {
        $error = _("Incorrect username or password");
    }
}
if ($error) {
    $_REQUEST["error"] = $error;
}
require_once "head.php";
require_once "menu.php";
require_once "messagebox.php";
?>
<div class="container-fluid main">
开发者ID:vincib,项目名称:domainepublic,代码行数:31,代码来源:login.php


示例18: draw_coupon

function draw_coupon($time = false)
{
    global $client;
    global $error;
    global $onload, $body;
    $t = $client->t;
    settitle('Coupon');
    setmenu('balance');
    $outbox = $client->getoutbox();
    if (!$time) {
        $time = mq($_REQUEST['time']);
    }
    $items = $outbox[$time];
    $timestr = hsc($time);
    $datestr = datestr($time);
    if ($items) {
        foreach ($items as $item) {
            $request = $item[$t->REQUEST];
            if ($request == $t->SPEND) {
                $assetname = hsc($item[$t->ASSETNAME]);
                $formattedamount = hsc($item[$t->FORMATTEDAMOUNT]);
                $note = hsc($item[$t->NOTE]);
                if ($note) {
                    $note = "<tr><td><b>Note:</b></td><td><span style=\"margin: 5px;\">{$note}</span></td></tr>\n";
                }
            } elseif ($request == $t->COUPONENVELOPE) {
                $coupon = hsc(trim($item[$t->COUPON]));
                $body = <<<EOT
<br/>
<b>Coupon for outbox entry at {$datestr}</b>
<table border="1">
<tr><td><b>Amount:</b></td><td><span style="margin: 5px;">{$formattedamount} {$assetname}</span></td></tr>
{$note}<tr><td><b>Coupon:</b></td><td><span style="margin: 5px;">{$coupon}</span></td></tr>
</table>
EOT;
                return;
            }
        }
    }
    $error = "Couldn't find coupon: {$timestr}";
    draw_balance();
}
开发者ID:billstclair,项目名称:trubanc,代码行数:42,代码来源:index.php


示例19: mq

<?php

// Simple file viewer
// Allows viewing of files with word wrap.
function mq($x)
{
    if (get_magic_quotes_gpc()) {
        return stripslashes($x);
    } else {
        return $x;
    }
}
$file = mq(@$_GET['file']);
$title = mq(@$_GET['title']);
$numbers = mq(@$_GET['numbers']);
$search = mq(@$_GET['search']);
$file = trim($file);
if ($title == '') {
    $title = $file;
}
$files = explode("\n", file_get_contents('viewtext.txt'));
foreach ($files as $idx => $line) {
    if ($line != '') {
        $parts = explode('|', $line);
        $name = $parts[0];
        $label = '';
        if (count($parts) > 1) {
            $label = " - " . $parts[1];
        }
        if ($file != '') {
            $files[$idx] = $name;
开发者ID:billstclair,项目名称:loomclient,代码行数:31,代码来源:viewtext.php


示例20: mqlist

function mqlist($query)
{
    $q = mq($query);
    if (!$q) {
        return false;
    }
    $res = array();
    while ($c = mysql_fetch_array($q)) {
        $res[] = $c;
    }
    return $res;
}
开发者ID:ludovictant,项目名称:piphone,代码行数:12,代码来源:functions.php



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
PHP mrbsDelEntry函数代码示例发布时间:2022-05-15
下一篇:
PHP mpull函数代码示例发布时间:2022-05-15
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap